如何使用Nuget安装Boost
我是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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我根据您的描述进行测试,并且安装了正确的提升。

在您的代码中,错误显示“未找到项目'默认值'”。
请检查包装管理器控制台中的此下拉框“ Defalut Project”,如果您选择的项目已被删除或卸载,则可能发生此错误。

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

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.
