在 Windows 上编译我自己的 PHP 扩展,但出现 LNK 2005 错误
我正在使用 VC 2008 Express,并尝试用它编译我自己的 PHP 扩展。对以下错误有什么想法吗?
------ Rebuild All started: Project: xsplit, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'xsplit', configuration 'Debug|Win32'
Compiling...
xsplit.cpp
c:\x\php-5.3.1\zend\zend_execute.h(231) : warning C4018: '>' : signed/unsigned mismatch
.\xsplit.cpp(64) : warning C4091: 'typedef ' : ignored on left of '_dict' when no variable is declared
.\xsplit.cpp(154) : warning C4101: 'file_size' : unreferenced local variable
.\xsplit.cpp(153) : warning C4101: 'fd' : unreferenced local variable
.\xsplit.cpp(417) : warning C4244: '=' : conversion from 'Darts::DoubleArrayBase<ValueType>::size_type' to 'float', possible loss of data
with
[
ValueType=int
]
.\xsplit.cpp(418) : warning C4244: '=' : conversion from 'int' to 'float', possible loss of data
.\xsplit.cpp(426) : warning C4244: '=' : conversion from 'size_t' to 'float', possible loss of data
.\xsplit.cpp(436) : warning C4244: '=' : conversion from 'Darts::DoubleArrayBase<ValueType>::size_type' to 'float', possible loss of data
with
[
ValueType=int
]
.\xsplit.cpp(437) : warning C4244: '=' : conversion from 'int' to 'float', possible loss of data
.\xsplit.cpp(445) : warning C4244: '=' : conversion from 'size_t' to 'float', possible loss of data
.\xsplit.cpp(455) : warning C4244: '=' : conversion from 'Darts::DoubleArrayBase<ValueType>::size_type' to 'float', possible loss of data
with
[
ValueType=int
]
.\xsplit.cpp(456) : warning C4244: '=' : conversion from 'int' to 'float', possible loss of data
.\xsplit.cpp(464) : warning C4244: '=' : conversion from 'size_t' to 'float', possible loss of data
.\xsplit.cpp(800) : 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.
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\string.h(74) : see declaration of 'strcpy'
.\xsplit.cpp(932) : warning C4101: 'hashval' : unreferenced local variable
.\xsplit.cpp(931) : warning C4101: 'arrht' : unreferenced local variable
Compiling manifest to resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation. All rights reserved.
Linking...
Searching libraries
Searching C:\x\php-5.3.1\bindlib_w32\php5ts.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\kernel32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\user32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\gdi32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\winspool.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\comdlg32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\advapi32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\shell32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\ole32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\oleaut32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\uuid.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbc32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbccp32.lib:
Searching C:\x\php-5.3.1\bindlib_w32\libcpmtd.lib:
libcpmtd.lib(cerr.obj) : error LNK2005: "bool __cdecl std::_Fputc<char>(char,struct _iobuf *)" (??$_Fputc@D@std@@YA_NDPAU_iobuf@@@Z) already defined in xsplit.obj
libcpmtd.lib(cerr.obj) : error LNK2005: "bool __cdecl std::_Ungetc<char>(char const &,struct _iobuf *)" (??$_Ungetc@D@std@@YA_NABDPAU_iobuf@@@Z) already defined in xsplit.obj
libcpmtd.lib(cerr.obj) : error LNK2005: "bool __cdecl std::_Fgetc<char>(char &,struct _iobuf *)" (??$_Fgetc@D@std@@YA_NAADPAU_iobuf@@@Z) already defined in xsplit.obj
libcpmtd.lib(cerr.obj) : error LNK2005: "public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (?_Orphan_all@_Container_base_secure@std@@QBEXXZ) already defined in xsplit.obj
libcpmtd.lib(string.obj) : error LNK2005: "public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (?_Orphan_all@_Container_base_secure@std@@QBEXXZ) already defined in xsplit.obj
libcpmtd.lib(locale0.obj) : error LNK2005: "void * __cdecl operator new(unsigned int,void *)" (??2@YAPAXIPAX@Z) already defined in xsplit.obj
libcpmtd.lib(locale0.obj) : error LNK2005: "void __cdecl operator delete(void *,void *)" (??3@YAXPAX0@Z) already defined in xsplit.obj
libcpmtd.lib(locale0.obj) : error LNK2005: "public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (?_Orphan_all@_Container_base_secure@std@@QBEXXZ) already defined in xsplit.obj
Searching C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\LIBCMTD.lib:
Searching C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
Searching C:\x\php-5.3.1\bindlib_w32\php5ts.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\kernel32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\user32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\gdi32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\winspool.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\comdlg32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\advapi32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\shell32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\ole32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\oleaut32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\uuid.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbc32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbccp32.lib:
Searching C:\x\php-5.3.1\bindlib_w32\libcpmtd.lib:
Finished searching libraries
Searching libraries
Searching C:\x\php-5.3.1\bindlib_w32\php5ts.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\kernel32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\user32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\gdi32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\winspool.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\comdlg32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\advapi32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\shell32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\ole32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\oleaut32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\uuid.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbc32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbccp32.lib:
Searching C:\x\php-5.3.1\bindlib_w32\libcpmtd.lib:
Searching C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\LIBCMTD.lib:
Searching C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
Searching C:\x\php-5.3.1\bindlib_w32\php5ts.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\kernel32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\user32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\gdi32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\winspool.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\comdlg32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\advapi32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\shell32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\ole32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\oleaut32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\uuid.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbc32.lib:
Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbccp32.lib:
Searching C:\x\php-5.3.1\bindlib_w32\libcpmtd.lib:
Finished searching libraries
c:\xproject\xsplit\Debug\xsplit.dll : fatal error LNK1169: one or more multiply defined symbols found
Build log was saved at "file://c:\xproject\xsplit\xsplit\Debug\BuildLog.htm"
xsplit - 9 error(s), 16 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你从哪里得到这个 libcpmtd.lib ?
Where did you get this libcpmtd.lib from?