Home > other >  How to use NuGet to install Boost
How to use NuGet to install Boost

Time:06-17

I am new to Visual Studio. I have cloned a git project that needs Boost.Test.

When I try to install Boost with the NuGet console (inside MSVC) I get this error below although the package clearly exists.

Is this the correct way to install Boost to use in a Visual Studio C project?

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> 

CodePudding user response:

I make a test according to your description and it installed boost correctly. enter image description here

In your code the error shows that “Project 'Default' is not found”.

Please check this drop down box “Defalut project” in Package Manager Console, this error may occur if the project you selected has already been deleted or unload. enter image description here

  • Related