簡體   English   中英

如何使用 NuGet 安裝 Boost

[英]How to use NuGet to install Boost

我是 Visual Studio 的新手。 我克隆了一個需要 Boost.Test 的 git 項目。

當我嘗試使用 NuGet 控制台(在 MSVC 內)安裝 Boost 時,我在下面收到此錯誤,盡管該軟件包顯然存在。

這是安裝 Boost 以在 Visual Studio C++ 項目中使用的正確方法嗎?

PM> Find-Package boost

Id                                  Versions                                 Description                                                                                                                           
--                                  --------                                 -----------                                                                                                                           
boost                               {1.79.0}                                 boost                                                                                                                                 
boost_filesystem-vc140              {1.79.0}                                 boost_filesystem-vc140. Compiler: Visual Studio 2015 Update 3.                                                                        
boost_system-vc140                  {1.79.0}                                 boost_system-vc140. Compiler: Visual Studio 2015 Update 3.                                                                            
boost_date_time-vc140               {1.79.0}                                 boost_date_time-vc140. Compiler: Visual Studio 2015 Update 3.                                                                         
boost_filesystem-vc120              {1.79.0}                                 boost_filesystem-vc120. Compiler: Visual Studio 2013 Update 5.                                                                        
boost_chrono-vc120                  {1.79.0}                                 boost_chrono-vc120. Compiler: Visual Studio 2013 Update 5.                                                                            
boost_date_time-vc141               {1.79.0}                                 boost_date_time-vc141. Compiler: Visual Studio 2017 15.9.45.                                                                          
boost_system-vc120                  {1.79.0}                                 boost_system-vc120. Compiler: Visual Studio 2013 Update 5.                                                                            
boost_thread-vc120                  {1.79.0}                                 boost_thread-vc120. Compiler: Visual Studio 2013 Update 5.                                                                            
boost_system-vc141                  {1.79.0}                                 boost_system-vc141. Compiler: Visual Studio 2017 15.9.45.                                                                             
boost_date_time-vc120               {1.79.0}                                 boost_date_time-vc120. Compiler: Visual Studio 2013 Update 5.                                                                         
boost_regex-vc140                   {1.79.0}                                 boost_regex-vc140. Compiler: Visual Studio 2015 Update 3.                                                                             
boost_thread-vc141                  {1.79.0}                                 boost_thread-vc141. Compiler: Visual Studio 2017 15.9.45.                                                                             
boost_chrono-vc141                  {1.79.0}                                 boost_chrono-vc141. Compiler: Visual Studio 2017 15.9.45.                                                                             
boost_regex-vc142                   {1.79.0}                                 boost_regex-vc142. Compiler: Visual Studio 2019 16.11.11.                                                                             
boost_log-vc140                     {1.79.0}                                 boost_log-vc140. Compiler: Visual Studio 2015 Update 3.                                                                               
boost_random-vc140                  {1.79.0}                                 boost_random-vc140. Compiler: Visual Studio 2015 Update 3.                                                                            
boost_regex-vc120                   {1.79.0}                                 boost_regex-vc120. Compiler: Visual Studio 2013 Update 5.                                                                             
boost_filesystem-vc141              {1.79.0}                                 boost_filesystem-vc141. Compiler: Visual Studio 2017 15.9.45.                                                                         
boost_serialization-vc140           {1.79.0}                                 boost_serialization-vc140. Compiler: Visual Studio 2015 Update 3.                                                                     
Time Elapsed: 00:00:01.1981777


PM>  Install-Package boost -Version 1.79.0
Install-Package : Project 'Default' is not found.
At line:1 char:2
+  Install-Package boost -Version 1.79.0
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Default:String) [Install-Package], ItemNotFoundException
    + FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
 
PM> 

我根據您的描述進行了測試,它正確安裝了boost。 在此處輸入圖像描述

在您的代碼中,錯誤顯示“找不到項目'默認'”。

請在 Package Manager Console 中勾選“Defalut project”這個下拉框,如果您選擇的項目已經被刪除或卸載,則可能會出現此錯誤。 在此處輸入圖像描述

暫無
暫無

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

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