• Advertisement

Archived

This topic is now archived and is closed to further replies.

VS 2003 .Net - Compiling Plain 'ol C

This topic is 5058 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey. I''m a little confused. I''m using VS 2003 .Net to compile a DLL written in C. Does VS have one C/C++ compiler to compile C programs, or is there a special setting I have to toggle to get it to compile as pure C? The purpose of writing this DLL was to get a speed improvement, and I don''t want any unnecessary C++ overhead. Does VS automatically detect if a project is just using C versus C++? It seems like it assumes I am using C++. ---------------------------------------- Let be be finale of seem, seems to me. ---------------------------------------- Shedletsky''s Code Library: Open source projects and demos

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I think it depends on the filename. if it''s .c you shouldn''t have any problems if it''s correct C code.

Share this post


Link to post
Share on other sites
Visual Studio .NET has detected when I am working with exclusively C code and compiled it appropriately, ie- no midcode variable declaration for example.

Share this post


Link to post
Share on other sites
As a sidenote, I am unaware whether Visual Studio .NET uses a unique C compiler, or whether the C compiler is just essentially a subset of the C++ compiler. In the case that the C compiler is unique you may want to consider compiling the code as C++ simply because I doubt the C compiler would have been updated recently and thus, may not produce as optimal code as the C++ compiler. Again this only goes under the assumption that the C compiler is unique and seperate.

Share this post


Link to post
Share on other sites
I have since discovered the /TP and /TC switches for toggling C compilation versus C++ compilation.

I don''t know if they are different compilers or not. But I do know that when I compiled my chess engine (written in C) with VS 2003 .Net, it ran 10% faster than when I compiled it in VS 6 - with all the same options.

So if they are different compilers, the one in VS 2003 is much better...

10% performance improvement! By using a compiler that is only newer by a couple of years, that''s incredible!

----------------------------------------
Let be be finale of seem, seems to me.
----------------------------------------

Shedletsky''s Code Library:

Open source projects and demos

Share this post


Link to post
Share on other sites
Aye, 2003.NET kills VS 6 in performance and standard conformance. Have you tried compiling it as a C++ program as opposed to a C program in .NET yet? Is there any performance difference?

Share this post


Link to post
Share on other sites

  • Advertisement