简体   繁体   English

在Visual Studio 2010中维护C项目?

[英]Maintain C projects in Visual Studio 2010?

Do you know of any extension (desired free) for VS (or VCPP) 10 that adds C projects productivity (ie templates, headers control, syntax highlighting etc.)? 你知道VS(或VCPP)10的任何扩展(期望免费),它增加了C项目的生产力(即模板,标题控制,语法高亮等)吗?

Thanks 谢谢

Visual Studio already ships with support for C. That includes project files, a compiler, header files, syntax highlighting and debugging support. Visual Studio已经附带了对C的支持。包括项目文件,编译器,头文件,语法突出显示和调试支持。 What are you missing (apart from C99)? 你错过了什么(除了C99)?

  1. Create a standard C++ project such as a Win32 Console Application (it doesn't matter which one). 创建一个标准的C ++项目,例如Win32控制台应用程序(哪一个无关紧要)。
  2. Add a new item (Project menu, Add New Item...) and select "C++ File (.cpp)" 添加一个新项(项目菜单,添加新项...)并选择“C ++文件(.cpp)”
  3. Here is the important step. 这是重要的一步。 Give the file a ".c" extension rather than a ".cpp" extension. 为文件提供“.c”扩展名而不是“.cpp”扩展名。 By calling the file ".c", Visual Studio will compile it as C instead of C++. 通过调用文件“.c”,Visual Studio将其编译为C而不是C ++。

Create a Win32 C++ project and from the Solution Explorer right-click your projcet and select Properties -> Configuration Properties -> C/C++ -> Advanced -> Compile As -> Compile As C. , then rename the *.cpp extensions to *.c and build your project. 创建一个Win32 C ++项目,在解决方案资源管理器中右键单击您的项目并选择属性 - >配置属性 - > C / C ++ - >高级 - > 编译为 - >编译为C. ,然后将* .cpp扩展名重命名为* .c并构建您的项目。
You may want to delete some unimportant files like stadfx.cpp and targetver.h (remove its linkage from stdafx.h). 您可能希望删除一些不重要的文件,如stadfx.cpp和targetver.h(从stdafx.h中删除其链接)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM