【发布时间】:2011-04-15 00:12:47
【问题描述】:
我是一个不幸的 Linux 编码员,我试图让我的一个项目在 Windows 7 中运行,这涉及构建 TagPy。我正在使用 MSVC2008 和 Python 2.7.1(x86 版本)。
我已成功安装 CMake 并构建了 TagLib,并从 BoostPro 安装程序安装了 Boost 标头和 Boost.Python 二进制文件。我在 configure.py 中设置了 boost 和 taglib 库目录,包括目录和库名称,以及 boost 编译器。
我的 %path%、%lib% 和 %libpath% 添加了 MSVC 等目录,由 VC 提供的批处理脚本设置。
我在链接上收到以下错误:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo
/INCREMENTAL:NO "/LIBPATH:C:/Program Files (x86)/taglib/lib" "/LIBPATH:C:\Progra
m Files (x86)\boost\boost_1_46_1\lib" /LIBPATH:C:\Python27\libs /LIBPATH:C:\Pyth
on27\PCbuild tagd.lib boost_python-vc90-mt-1_46_1.lib /EXPORT:init_tagpy build\t
emp.win32-2.7\Release\src/wrapper/basics.obj build\temp.win32-2.7\Release\src/wr
apper/id3.obj build\temp.win32-2.7\Release\src/wrapper/rest.obj /OUT:build\lib.w
in32-2.7\_tagpy.pyd /IMPLIB:build\temp.win32-2.7\Release\src/wrapper\_tagpy.lib
/MANIFESTFILE:build\temp.win32-2.7\Release\src/wrapper\_tagpy.pyd.manifest
Creating library build\temp.win32-2.7\Release\src/wrapper\_tagpy.lib and obje
ct build\temp.win32-2.7\Release\src/wrapper\_tagpy.exp
basics.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) pu
blic: __thiscall TagLib::String::String(class std::basic_string<wchar_t,struct s
td::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,enum TagLib::St
ring::Type)" (__imp_??0String@TagLib@@QAE@ABV?$basic_string@_WU?$char_traits@_W@
std@@V?$allocator@_W@2@@std@@W4Type@01@@Z) referenced in function "public: stati
c void __cdecl boost::python::converter::implicit<class std::basic_string<wchar_
t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class TagLib:
:String>::construct(struct _object *,struct boost::python::converter::rvalue_fro
m_python_stage1_data *)" (?construct@?$implicit@V?$basic_string@_WU?$char_traits
@_W@std@@V?$allocator@_W@2@@std@@VString@TagLib@@@converter@python@boost@@SAXPAU
_object@@PAUrvalue_from_python_stage1_data@234@@Z)
build\lib.win32-2.7\_tagpy.pyd : fatal error LNK1120: 1 unresolved externals
我错过了什么?
(注意:我之前在未解决的外部也有与 Boost 相关的异常,但将 /EHsc 作为编译器标志传递已修复。)
【问题讨论】:
标签: python windows taglib boost-python