2016-08-11 30 views
0

我想安裝DLIB模塊,我已經安裝了CMake的升壓蟒蛇但蟒蛇當我安裝DLIB它給我的錯誤:如何將BOOST_ROOT和BOOST_LIBRARY傳遞給CMake?

We couldn't find the right version of boost python. If you installed boost and you are still getting this error then you might have installed a version of boost that was compiled with a different version of visual studio than the one you are using. So you have to make sure that the version of visual studio is the same version that was used to compile the copy of boost you are using. -- Set the BOOST_ROOT and BOOST_LIBRARYDIR environment variables before running cmake.

例如事情是這樣的:

set BOOST_ROOT=C:\local\boost_1_57_0 

set BOOST_LIBRARYDIR=C:\local\boost_1_57_0\stage\lib 

我無法弄清楚如何設置BOOST_ROOTBOOST_LIBRARYDIR路徑。

回答

1

臨時設置環境變量運行的CMake之前,你可以在控制檯輸入這些命令:

set BOOST_ROOT=C:\local\boost_1_57_0 
set BOOST_LIBRARYDIR=C:\local\boost_1_57_0\stage\lib 
cmake ... 

要永久設置它們,你可以使用setx或通過單擊Windows圖形用戶界面。

我建議對這些做法,更乾淨和可靠的方式將通過這些變量直接CMake的:

cmake -DBOOST_ROOT=C:\local\boost_1_57_0 -DBOOST_LIBRARYDIR=C:\local\boost_1_57_0\stage\lib 
+0

當我在命令行中運行「pip install dlib」時,根據您的解決方案設置變量後,會給我帶來相同的錯誤i-e「設置BOOST_ROOT和BOOST_LIBRARYDIR」,但是升級已成功安裝。 –

0

cmake電話與-D後只需添加他們。你的情況,這將是

cmake -DBOOST_ROOT=C:\local\boost_1_57_0 -DBOOST_LIBRARYDIR=C:\local\boost_1_57_0\stage\lib .. 

你應該給定的命令之前清除CMake的緩存(刪除構建目錄或只是CMakeCache.txt文件)。

+0

根據你的解決方案,它成功地建立了文件,但之後,當我安裝dlib模塊使用這個命令「pip install dlib」給了我同樣的錯誤當我運行這個命令時沒有找到提升。 –

+0

這與這個問題無關。 – usr1234567

相關問題