I recently got some code in C that needed to be setup in a visual studio project. Its not hard but I thought I'd still share the information:
- Start with a new project.
- Select Visual C++ "Win32 Console Application".
- Check the "Empy Project" in Application Settings along with leaving the default radio "Console Application" checked
- Add your files to the newly created project
- Select "Project Properties -> c/c++ -> Advanced" and set the option "Compile As" to "Compile as C Code" (/TC)
- Click OK
Enjoy!
Thanks for the info. I tried to create a project and build some old C code, and got and error with cerrno. It seems to have a problem with the "using :: errno;" in cerrno If you would happen to have any ideas, would be appreciated. Try to make a build of something old for someone. Thanks.
ReplyDeleteusing is for namespaces which I believe are available in c++ not c (can you see any classes in your code? if so its c++).
ReplyDeleteSo you might want to uncheck "Compile as C Code"
Plz tell me how to compile a project via command line... I am used to work using geany editor and comile via gcc but in my University, it is quite pathetic to start project for even single line of code in VS...
ReplyDeleteThanks alot....
ReplyDelete