私は何らかの明らかな間違いを犯しているに違いありませんが、何時間も戦った後、私はそれ以上進歩することができません:
Boost 1.54、CMake 2.8.12、および Python 2.7.5 (3 つすべてが少し前のマイナー バージョンから) にアップグレードした後、私のプロジェクトの Python バインディングはデバッグ構成でリンクしなくなりました (リリースでは正常にリンクされます)。VS 2012 でビルドしています。更新前はすべて正常に動作していました。
Boost を標準的な方法で作成bootstrap.bat
しましたb2 address-model=64 toolset=msvc-11.0
。私のシステムには、b2 によって取得される Python 2.7 がインストールされています。
notice: [python-cfg] Configuring python...
notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\"
notice: [python-cfg] Checking interpreter command "python"...
notice: [python-cfg] running command 'DIR /-C /A:S "C:\Python27\python.exe" 2>&1'
notice: [python-cfg] running command 'python -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
notice: [python-cfg] ...requested configuration matched!
notice: [python-cfg] Details of this Python configuration:
notice: [python-cfg] interpreter command: "python"
notice: [python-cfg] include path: "C:\Python27\Include"
notice: [python-cfg] library path: "C:\Python27\libs"
notice: [python-cfg] DLL search path: "C:\Python27"
私のマシンには、他の Python がインストールされていません。
プロジェクトで CMake を実行すると、すべてがうまく見えます。
Found PythonLibs: optimized;C:/Python27/libs/python27.lib;debug;C:/Python27/libs/python27_d.lib (found version "2.7.5")
デバッグでのリンカーのコマンド ラインの関連部分は、次のとおりです。
"C:\franz\dev\boost_1_54_0\stage\lib\libboost_python-vc110-mt-gd-1_54.lib" "C:\Python27\libs\python27_d.lib"
最終的にデバッグでプロジェクトをビルドすると:
LINK : fatal error LNK1104: cannot open file 'python27.lib'
python27.lib
リンカのコマンドラインにはどこにも言及されていないので、16 進エディタで編集したところ、(形式の) へのlibboost_python-vc110-mt-gd-1_54.lib
参照が含まれていることがわかりました。python27.lib
/DEFAULTLIB:"python27.lib"
python27_d.lib
Boost をビルドするときに何か間違ったことをしていますか? これは、Boost 1.54 の Boost.Python に関する既知の問題ですか? どんな助けでも大歓迎です。
更新 #1: Boost 1.51 と 1.50 で再試行しましたが、同じ問題が発生するため、Boost のリグレッションではありません。
更新 #2: Python インストールから Python lib (python27_d.lib) のデバッグ バージョンを削除したため、標準の Python インストールに戻りました。次に、Boost 1.51 と自分のプロジェクトを再構築しました (CMake が期待どおりに単一のライブラリ ファイルを報告しました: Found PythonLibs: C:/Python27/libs/python27.lib (found version "2.7.5")
)。問題は解決しませんが、エラー メッセージに python27_d.lib: LINK : fatal error LNK1104: cannot open file 'python27_d.lib'
!
更新 #3: Process Monitorを使用すると、python27_d.lib がC:\Python27\libs\
実際に存在する場所で検索されない可能性があります。
3:35:28.0550683 PM link.exe 10132 CreateFile C:\franz\dev\appleseed\build\appleseed.python\python27_d.lib NAME NOT FOUND Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
3:35:28.0551846 PM link.exe 10132 CreateFile C:\franz\dev\boost_1_50_0\stage\lib\python27_d.lib NAME NOT FOUND Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
3:35:28.0552474 PM link.exe 10132 CreateFile C:\franz\dev\boost_1_50_0\stage\lib\Debug\python27_d.lib PATH NOT FOUND Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
3:35:28.0553595 PM link.exe 10132 CreateFile C:\franz\dev\appleseed\build\appleseed.python\python27_d.lib NAME NOT FOUND Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
3:35:28.0556105 PM link.exe 10132 CreateFile C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\amd64\python27_d.lib NAME NOT FOUND Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
3:35:28.0559637 PM link.exe 10132 CreateFile C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\amd64\python27_d.lib NAME NOT FOUND Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
3:35:28.0560984 PM link.exe 10132 CreateFile C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64\python27_d.lib NAME NOT FOUND Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
3:35:28.0561741 PM link.exe 10132 CreateFile C:\franz\dev\appleseed\build\appleseed.python\python27_d.lib NAME NOT FOUND Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, AllocationSize: n/a
更新 #4 : 関連する質問: Visual C++ デバッグ ライブラリの命名規則