项目警告阻止生成 lib 文件
编译期间,仅报告警告。在项目设置中,“将警告视为错误”已取消选中。但 .lib
文件未生成,链接失败。下面是我的构建日志。请帮忙。
1>------ Build started: Project: pcwscommon, Configuration: Release Win32 ------
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>wsxmlvld.cpp
1>e:\ws_name\eBiz\powrmart\sdk\include\sdkcmn/ivector.hpp(49) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/string.h(74) : see declaration of 'strcpy'
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmn2s.hpp(364) : warning C4351: new behavior: elements of array 'PmI64Str::m_buf' will be default initialized
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(280) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/stdio.h(366) : see declaration of 'sprintf'
1> e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(298) : see reference to function template instantiation 'PM_LEN pmtFtoa<char>(double,CCC *,PM_BOOLEAN)' being compiled
1> with
1> [
1> CCC=char
1> ]
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(292) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/stdio.h(366) : see declaration of 'sprintf'
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(240) : warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _stricmp. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/string.h(215) : see declaration of 'stricmp'
1> e:\ws_name\eBiz\powrmart\common\cmnmisc\pmdate.hpp(715) : see reference to function template instantiation 'int pmtStricmpAscii<char>(const CCC *,const char *)' being compiled
1> with
1> [
1> CCC=char
1> ]
1>wsxmlreptbl.cpp
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmn2s.hpp(364) : warning C4351: new behavior: elements of array 'PmI64Str::m_buf' will be default initialized
1>e:\ws_name\eBiz\powrmart\sdk\include\sdkcmn/ivector.hpp(49) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/string.h(74) : see declaration of 'strcpy'
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(280) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/stdio.h(366) : see declaration of 'sprintf'
1> e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(298) : see reference to function template instantiation 'PM_LEN pmtFtoa<char>(double,CCC *,PM_BOOLEAN)' being compiled
1> with
1> [
1> CCC=char
1> ]
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(292) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/stdio.h(366) : see declaration of 'sprintf'
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(240) : warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _stricmp. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/string.h(215) : see declaration of 'stricmp'
1> e:\ws_name\eBiz\powrmart\common\cmnmisc\pmdate.hpp(715) : see reference to function template instantiation 'int pmtStricmpAscii<char>(const CCC *,const char *)' being compiled
1> with
1> [
1> CCC=char
1> ]
1>Generating Code...
1>Linking...
1>LINK : fatal error LNK1181: cannot open input file 'pmwscmn.lib'
1>Build log was saved at "file://e:\ws_name\eBiz\main\pcws\common\Release\BuildLog.htm"
1>pcwscommon - 1 error(s), 10 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
During compilation, there are only warnings reported. In project settings "Treat warnings as errors" has been unchecked. But the .lib
file is not getting generated and the linking fails. Below is my build log. Please help.
1>------ Build started: Project: pcwscommon, Configuration: Release Win32 ------
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>wsxmlvld.cpp
1>e:\ws_name\eBiz\powrmart\sdk\include\sdkcmn/ivector.hpp(49) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/string.h(74) : see declaration of 'strcpy'
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmn2s.hpp(364) : warning C4351: new behavior: elements of array 'PmI64Str::m_buf' will be default initialized
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(280) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/stdio.h(366) : see declaration of 'sprintf'
1> e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(298) : see reference to function template instantiation 'PM_LEN pmtFtoa<char>(double,CCC *,PM_BOOLEAN)' being compiled
1> with
1> [
1> CCC=char
1> ]
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(292) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/stdio.h(366) : see declaration of 'sprintf'
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(240) : warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _stricmp. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/string.h(215) : see declaration of 'stricmp'
1> e:\ws_name\eBiz\powrmart\common\cmnmisc\pmdate.hpp(715) : see reference to function template instantiation 'int pmtStricmpAscii<char>(const CCC *,const char *)' being compiled
1> with
1> [
1> CCC=char
1> ]
1>wsxmlreptbl.cpp
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmn2s.hpp(364) : warning C4351: new behavior: elements of array 'PmI64Str::m_buf' will be default initialized
1>e:\ws_name\eBiz\powrmart\sdk\include\sdkcmn/ivector.hpp(49) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/string.h(74) : see declaration of 'strcpy'
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(280) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/stdio.h(366) : see declaration of 'sprintf'
1> e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(298) : see reference to function template instantiation 'PM_LEN pmtFtoa<char>(double,CCC *,PM_BOOLEAN)' being compiled
1> with
1> [
1> CCC=char
1> ]
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(292) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/stdio.h(366) : see declaration of 'sprintf'
1>e:\ws_name\ebiz\powrmart\common\cmnmisc\pmtstring.hpp(240) : warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _stricmp. See online help for details.
1> e:\Program Files\Microsoft Visual Studio 9.0\VC\include\../include/string.h(215) : see declaration of 'stricmp'
1> e:\ws_name\eBiz\powrmart\common\cmnmisc\pmdate.hpp(715) : see reference to function template instantiation 'int pmtStricmpAscii<char>(const CCC *,const char *)' being compiled
1> with
1> [
1> CCC=char
1> ]
1>Generating Code...
1>Linking...
1>LINK : fatal error LNK1181: cannot open input file 'pmwscmn.lib'
1>Build log was saved at "file://e:\ws_name\eBiz\main\pcws\common\Release\BuildLog.htm"
1>pcwscommon - 1 error(s), 10 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的链接器说它找不到输入“pmwscmn.lib”。
这是构建 pcwscommon 输出所必需的。
无论哪个项目构建“pmwscmn.lib”,要么尚未运行(您可能缺少依赖项),要么已失败,或者 pmwscmn.lib 是二进制文件,不在您的 lib 路径中。
You linker is saying it can't find input 'pmwscmn.lib'.
This is needed in order for the output from pcwscommon to be built.
Whichever project builds 'pmwscmn.lib' either hasn't been run yet (you may be missing dependencies), or has failed, or pmwscmn.lib is a binary, that isn't in your lib path.