VC++不能编译文件
编号:QA001095
建立日期: 1999年6月1日 最后修改日期:1999年6月1日
所属类别:
zhengsheng:
Visual C++6.0
Win95
使用过程:
1、新建一个text文件
2、输入源程序
3、运行compile
4、出现提示:
this build command requires an active project workspace. Would you like to create a default project workspace.
5、选确定
6、出现提示:
Cannot compile the file'c:\temp\text1.txt':no compile tool is associated with the file extension. (我把text文件放在C盘的TEMP目录下)
请问为什么回出现这种问题?
回答:
VC++是工具文件的扩展名来决定使用什么工具处理。比如.c和.cpp使用C/C++编译器进行编译;.rc作为资源文件处理;.txt作为文本文件处理。你的文件扩展名为.txt,所以VC++不会作为C/C++文件进行编译的。如果你希望编译,必须将扩展名改为.c或.cpp。需要说明的是对于.c和.cpp文件VC++的处理也不太一样:对于.c的文件按C语言用法编译,而.cpp按C++的语法处理。
此问题由李海回答。
| |
|
|
| |
|
|