我正在VS2008中编译一个PHP扩展。它依赖于另外三个我静态链接的项目。当我把所有的代码都放在一个.cpp文件中时,它过去工作得很好。为了使代码更易于管理,我将代码分成几个文件,现在它无法编译。
我得到了几个(每个文件100)链接器错误,LNK2005 (已经定义)。我认为它们都与运行时库有关。
到目前为止我已经试过了
有什么想法吗?
编辑:以下是一些错误:一些错误:
MPQBlock.obj : error LNK2005: _getwchar already defined in MPQArchive.obj
MPQBlock.obj : error LNK2005: _putwchar already defined in MPQArchive.obj
MPQBlock.obj : error LNK2005: _acosl already defined in MPQArchive.obj
MPQBlock.obj : error LNK2005: _asinl already defined in MPQArchive.obj
etc.
MPQFile.obj : error LNK2005: _asinf already defined in MPQArchive.obj
MPQFile.obj : error LNK2005: _atanf already defined in MPQArchive.obj
MPQFile.obj : error LNK2005: _atan2f already defined in MPQArchive.obj
MPQFile.obj : error LNK2005: _ceilf already defined in MPQArchive.obj
MPQFile.obj : error LNK2005: _cosf already defined in MPQArchive.obj
etc.
PHPExtension.obj : error LNK2005: _acosl already defined in MPQArchive.obj
PHPExtension.obj : error LNK2005: _asinl already defined in MPQArchive.obj
PHPExtension.obj : error LNK2005: _atanl already defined in MPQArchive.obj
PHPExtension.obj : error LNK2005: _atan2l already defined in MPQArchive.obj
etc.
zlibd.lib(zutil.obj) : warning LNK4217: locally defined symbol _malloc imported in function _zcalloc
zlibd.lib(zutil.obj) : warning LNK4217: locally defined symbol _free imported in function _zcfree
D:\Server\PHP\ext\php_mpq_library.dll : fatal error LNK1169: one or more multiply defined symbols found发布于 2010-03-09 06:10:45
更改链接库的顺序可能有助于.你能不能把这些错误..。这会让画面更清晰..。
单击Settings.
注意,在“对象/库模块”框中的/NOD:.
Nafxcwd.lib )列出。
https://stackoverflow.com/questions/2403371
复制相似问题