簡體   English   中英

Boost : 致命錯誤 LNK1104: 無法打開文件 (lib)

[英]Boost : fatal error LNK1104: cannot open file (lib)

我已經將所有關於 boost 問題的主題都標記為紅色,但我的問題有所不同:我在 VS 中收到一個錯誤: 1>LINK : fatal error LNK1104: cannot open file 'C:\\boost_1_72_0\\stage\\lib\\boost_python37-vc140-mt-gd-x32-1_67.lib'我再次使用 b2 & bootstrap 命令在 VS 所有庫中再次安裝。 python 的那些名稱是: 例如: libboost_python37-vc141-mt-gd-x32-1_72為什么 VS 在這個庫的名稱中要求我提供vc1401_67 我該如何解決?

評論中提到的問題原因,之前安裝了一個boost版本(1.67)。 解決方案:在 boost 文檔中找到: https://www.boost.org/doc/libs/1_72_0/more/getting_started/windows.html : https://www.boost.org/doc/libs/1_72_0/more/getting_started/windows.html

Build From the Visual Studio IDE
From Visual Studio's File menu, select New > Project…

In the left-hand pane of the resulting New Project dialog, select Visual C++ > Win32.

In the right-hand pane, select Win32 Console Application (VS8.0) or Win32 Console Project (VS7.1).

In the name field, enter “example”

Right-click example in the Solution Explorer pane and select Properties from the resulting pop-up menu

In Configuration Properties > C/C++ > General > Additional Include Directories, enter the path to the Boost root directory, for example

C:\Program Files\boost\boost_1_72_0

In Configuration Properties > C/C++ > Precompiled Headers, change Use Precompiled Header (/Yu) to Not Using Precompiled Headers.2

Replace the contents of the example.cpp generated by the IDE with the example code above.

From the Build menu, select Build Solution.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM