PDA

View Full Version : Compiler options



cadhelp Van
2007-10-12, 07:31 PM
Does anybody know how to compile *.cs file for autocad

csc /t:library /r:C:\Program Files\AutoCAD 2007\acdbmgd.dll,C:\Program Files\AutoCAD 2007\acmgd.dll /out:c:\acad\net\com.dll c:\acad\net\com.cs

or something like that?

What is the syntax of the DOS command line?

Thanks

sinc
2007-10-12, 09:24 PM
I would forget about that and download something like VS Express - C# Edition. Then it's as easy as hitting "Build" (assuming you have your project references set correctly).

Is there some particular reason why you're trying to use the Command Prompt? (BTW, it isn't really a DOS prompt... DOS is dead.)

cadhelp Van
2007-10-15, 08:16 PM
>>DOS is dead.) well, cmd

>>Is there some particular reason..
IT dep. as a part of business case, ability to perform .NET customization without any third part involvement (theoretically)

Thanks

Ed Jobe
2007-10-15, 08:46 PM
IT dep. as a part of business case, ability to perform .NET customization without any third part involvement (theoretically)

Thanks
You mean you're going try to write code without an IDE? e.g. Notepad?

dgorsman
2007-10-15, 11:13 PM
You mean you're going try to write code without an IDE? e.g. Notepad?

Ugh. Isn't that akin to writing assembly code by looking up instructions in the CPU manual?

cadhelp Van
2007-10-16, 03:14 PM
As I sad, theoretically

Just as an argument, I can do it in notepad, but it’ll take much longer

Ed Jobe
2007-10-16, 04:08 PM
As I sad, theoreticallyI believe you would at least have to install the NET sdk. There is no compliler in the clr.

cadhelp Van
2007-10-16, 04:31 PM
framework is there, you cant install ACAD2007 without it

Any way a problem is solved

the batch file i created looks like this

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc /lib:"C:\Program Files\AutoCAD 2007","C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" /reference:acdbmgd.dll,acmgd.dll /out:c:\acad\MyCsharpDll.dll C:\ACAD\MyCsharpDll.cs

http://msdn2.microsoft.com/en-us/library/2fdbz5xd(VS.71).aspx

in addition, I had to put the dummy main function into the code, otherwise it comes to an compiler error "No main function for entry point"
Something like that
class dllMain
{
static void Main()
{
;
}
}

Thanks to everybody