文章类型: VC&C++
关键词: VS,vc,遇到,问题,集锦,warning,MSB8004
内容摘要: vc遇到问题集锦,VS2010 这个warning怎么解决

vc遇到问题集锦VS中这个warning怎么解决

2019/5/9 9:42:42    来源:apple    阅读:

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(298,5): warning MSB8004: Intermediate Directory does not end with a trailing slash.  This build instance will add the slash as it is required to allow proper evaluation of the Intermediate Directory.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(299,5): warning MSB8004: Output Directory does not end with a trailing slash.  This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.

 

 

warning MSB8004: Intermediate 目录未以斜杠结尾。此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Intermediate 目录。
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(299,5): warning MSB8004: Output 目录未以斜杠结尾。此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。

 

顾名思义,就是你在工程属性里面,设置Intermediate目录时没有以斜杠结束,编译器帮你自动加了。


------------------------------------------------------------------------------------------------------

 

一、warning MSB8004: Output Directory does not end with a trailing slash错误

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets(346,5): warning MSB8004: Output Directory does not end with a trailing slash.  This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.

1>  ***.vcxproj -> D:\DJ01\src\CarSimulation\SimulationModule\compiler\./../lib\***.lib

 

该错误提醒是:在生成路径的设置字符串后面没有添加反斜杠\,已经帮你添加了。

找到别人也遇到这个问题:

warning MSB8004: Intermediate 目录未以斜杠结尾。此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Intermediate 目录。
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(299,5): warning MSB8004: Output 目录未以斜杠结尾。此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。 

顾名思义,就是你在工程属性里面,设置Intermediate目录时没有以斜杠结束,编译器帮你自动加了。

修正方法就是在工程属性里面把生成路径的最后都添加上'\"就可以了。

 


二、如何解决 warning LNK4217 错误
1、错误提示:****.lib(****.obj) :warning LNK4217: 本地定义的符号 **** 在函数 **** 中导入
****.lib(****.obj) :error LNK2019: 无法解析的外部符号 ******,该符号在函数 _**** 中被引用解决方法:运行时库(工程属性--〉配置属性--〉C/C++ --〉代码生成--〉运行时库) 改成 “多线程(/MT)”并重新生成,就可以 编译过去了
2、采用上述办法的时候发现新的错误:1>d:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxver_.h(81): fatal error C1189: #error :  Please use the /MD switch for _AFXDLL builds
经过查看工程属性页的预处理器,有_AFXDLL的宏定义,无法去掉,于是我考虑应该是生成程序的类型的设置上,于是找到“配置属性”-》MFC的使用,把“在共享 DLL 中使用 MFC”修改为“在静态库中使用 MFC”,问题得以解决。
3、但是随即运行程序发现有异常出现,于是我只好先改回去还是先让产生link4217吧。因为这个程序还是使用了一些dll的,这些dll是别人提供的。

↑ 上一篇文章:vs 2017 打开资源视图 关键词:vs,2017,打开,资源视图 发布日期:2019/5/9 9:02:36
↓ 下一篇文章:Android主线程不能访问网络异常解决办法 关键词:Android,主线程,不能,访问,网络,异常,解决,办法 发布日期:2019/10/22 15:55:48
相关文章:
VC++中出现[warning C4996]: 'sprintf': This function or variable may be unsafe 关键词:VS,VC++,VC,warning,C4996,sprintf,This,function,o.. 发布日期:2016-09-30 10:11
vs2010 vc++ malloc分配内存 关键词:vs2010,vc++,malloc分配内存 发布日期:2017-05-12 16:06
VC,C++,6.0,debug,断点,调试,出现,One or more breakpoints cannot be set and have been disabled,不能,调试,问题 关键词:VC++6.0,debug断点调试时出现One,or,more,breakpoints,cann.. 发布日期:2019-05-06 16:28
相关目录:.NETVC&C++
我要评论
正在加载评论信息......