在做MFC对话框时候,没有额外加头文件运行没有错误。但是当我在StdAfx.h中加入头文件,编译时,出现一个对话框,说:can not compile the file'D:\...\StdAfx.h':no compile tool is associated with the file extension.
请问这是怎么回事啊?我把头文件加在stdafx.h难道有错吗?我试着加在其他地方的开头也有类似的错误。
...全文
40414打赏收藏
MFC头文件问题,求助
在做MFC对话框时候,没有额外加头文件运行没有错误。但是当我在StdAfx.h中加入头文件,编译时,出现一个对话框,说:can not compile the file'D:\...\StdAfx.h':no compile tool is associated with the file extension. 请问这是怎么回事啊?我把头文件加在stdafx.h难道有错吗?我试着加在其他地方的开头也有类似的错误。
你把头文件加到stdafx.h没错,但是你测试的时候,应该编译包含这个stdafx.h文件的.cpp文件。编译器不会单独对.h文件进行编译的。an not compile the file'D:\...\StdAfx.h':no compile tool is associated with the file extension.这句话,就是这个意思。估计你是直接在stdafx.h里面按下了编译按钮
[Quote=引用楼主 ttaileen 的帖子:]
在做MFC对话框时候,没有额外加头文件运行没有错误。但是当我在StdAfx.h中加入头文件,编译时,出现一个对话框,说:can not compile the file'D:\...\StdAfx.h':no compile tool is associated with the file extension.
请问这是怎么回事啊?我把头文件加在stdafx.h难道有错吗?我试着加在其他地方的开头也有类似的错误。
[/Quote]
你把头文件加到stdafx.h没错,但是你测试的时候,应该编译包含这个stdafx.h文件的.cpp文件。编译器不会单独对.h文件进行编译的。an not compile the file'D:\...\StdAfx.h':no compile tool is associated with the file extension.这句话,就是这个意思。估计你是直接在stdafx.h里面按下了编译按钮。
[Quote=引用楼主 ttaileen 的帖子:]
在做MFC对话框时候,没有额外加头文件运行没有错误。但是当我在StdAfx.h中加入头文件,编译时,出现一个对话框,说:can not compile the file'D:\...\StdAfx.h':no compile tool is associated with the file extension.
请问这是怎么回事啊?我把头文件加在stdafx.h难道有错吗?我试着加在其他地方的开头也有类似的错误。
[/Quote]
加在里面没错,但是不管怎么说你都不能够只单独编译头文件.