Sam*_*Sam 16 c lnk2005 visual-studio-2008 visual-studio visual-c++
(为什么我要这样做:我没有运气在Windows上使用libpng预先构建的二进制文件(尽管经过了数小时的试验和错误),因此我现在正在尝试自己编译它.我发现这个有用的博客关于此的帖子,完成了Microsoft Visual Studio 2008项目文件,但遗憾的是仍然无法使用它.)
它在链接到此处找到的zlib二进制文件时成功编译,但在尝试将其链接到测试文件时,我收到以下内容:
C:\Documents and Settings\Administrator\My Documents>cl "C:\Documents and Settin
gs\Administrator\My Documents\test.c" "C:\Documents and Settings\Administrator\M
y Documents\libpng.lib" -I "C:\Documents and Settings\Administrator\My Documents\include"
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.c
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
test.obj
"C:\Documents and Settings\Administrator\My Documents\libpng.lib"
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _abort already defined in LIBCMT.lib(
abort.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fread already defined in LIBCMT.lib(
fread.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _malloc already defined in LIBCMT.lib
(malloc.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free already defined in LIBCMT.lib(f
ree.obj)
MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: ___iob_func already defined in LIBCMT
.lib(_file.obj)
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; u
se /NODEFAULTLIB:library
test.exe : fatal error LNK1169: one or more multiply defined symbols found
任何人都可以关心如何解决这些错误?
Tho*_*ini 37
问题是两个项目中的一个使用多线程DLL,而另一个项目在项目属性 - >配置属性 - > C/C++ - >代码生成中使用多线程(没有DLL).
好几次发生在我身上.
确保即使对于发布版本以及每种可能的组合(调试,非调试等),"同步"该设置
| 归档时间: |
|
| 查看次数: |
23999 次 |
| 最近记录: |