如何使用Nuget安装Boost

发布于 2025-02-07 18:06:26 字数 5335 浏览 1 评论 0原文

我是Visual Studio的新手。 我已经克隆了一个需要boost.test的git项目。

当我尝试使用Nuget控制台安装Boost(在MSVC内部)时,我在下面会出现此错误,尽管该软件包显然存在。

这是在Visual Studio C ++项目中安装Boost的正确方法吗?

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> 

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> 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

活泼老夫 2025-02-14 18:06:26

我根据您的描述进行测试,并且安装了正确的提升。

在您的代码中,错误显示“未找到项目'默认值'”。

请检查包装管理器控制台中的此下拉框“ Defalut Project”,如果您选择的项目已被删除或卸载,则可能发生此错误。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文