簡體   English   中英

鏈接到Boost庫時遇到問題(Visual Studio 2013中的C ++)

[英]Having issues with linking to boost library (C++ in Visual Studio 2013)

我已經為此努力了幾天。 我嘗試下載並編譯最新的Boost 1.67.0,以包括

#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/process.hpp>

但是在嘗試編譯時出現了以下錯誤(我注意到的一件事是該路徑在錯誤日志中的斜線走錯了方向,我不確定該如何解決?

我嘗試使用標准cmd以及Visual Studio 2013提示符進行編譯(結果相同)。

然后,我嘗試從boost網站獲取預編譯版本

boost_1_67_0-msvc-12.0-32.exe

而且仍然遇到同樣的問題。 #include文本未在編輯器中加下划線。 我還有其他包含目錄,它們指向:

C:\VisualStudioLibraries\boost_1_67_0

和鏈接器其他庫目錄到

C:\VisualStudioLibraries\boost_1_67_0\stage\lib

有誰知道如何解決這個問題? 如果我注釋掉#include行以增強代碼,則代碼編譯不會出現任何問題,並且程序會運行。 我的代碼還沒有使用boost中的任何東西,所以其中唯一與boost相關的東西是3 #include行。

錯誤是:

1> MyForm.cpp 1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(65):錯誤C3646:'noexcept':未知的覆蓋說明符1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(72):錯誤C2660:'boost :: process :: process_error :: process_error':函數沒有2個參數1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp( 77):錯誤C2660:'boost :: process :: process_error :: process_error':函數不接受2個參數1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(82):錯誤C2440: '':無法從'std :: error_code'轉換為'boost :: process :: process_error'1>沒有構造函數可以采用源類型,或者構造函數重載解析度不明確1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process /detail/config.hpp(88):錯誤C2440:'':無法從'const std :: error_code'轉換為'boost :: process :: process_error'1>沒有構造函數可以采用源類型,或構造函數重載r esolution模棱兩可1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(94):錯誤C2660:'boost :: process :: process_error :: process_error':函數沒有2個參數1> C :\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(97):錯誤C2146:語法錯誤:缺少';' 標識符'Char'之前1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(97):錯誤C2146:語法錯誤:缺少';' 標識符'null_char'之前1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(97):錯誤C4430:缺少類型說明符-假定為int。 注意:C ++不支持default-int 1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(98):錯誤C2144:語法錯誤:'char'應該以';'開頭 1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(98):錯誤C2143:語法錯誤:缺少';' 在'<'1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(99)之前:錯誤C2143:語法錯誤:缺少';' 在'{'1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(99)之前:錯誤C2447:'{':缺少函數標頭(舊式正式列表?)1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(101):錯誤C2146:語法錯誤:缺少';' 標識符'Char'之前1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(101):錯誤C2146:語法錯誤:缺少';' 標識符'equal_sign'之前1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(101):錯誤C4430:缺少類型說明符-假定為int。 注意:C ++不支持default-int ==========生成:0成功,1失敗,0最新,跳過0 ==========

非常感謝大家。

好吧,我確定這不是大多數人想要聽到的答案,但是在嘗試了一周以上使其正常工作之后,最終工作的唯一方法是轉到Visual Studio2017。所有內容在此處進行鏈接和編譯都很好。 也許我的VS2013安裝存在問題(但其他所有操作都可以正常工作)。

暫無
暫無

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

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