【问题标题】:installation of freeglut in visual studio 2019在 Visual Studio 2019 中安装 freeglut
【发布时间】:2020-04-26 13:53:47
【问题描述】:

我尝试了多种在 Visual Studio 中安装 freeglut 的方法,但都无法正常工作。我有一个解决方案,但我不知道如何使用。解决方案是这样的 1.打开powershell。 2. git克隆https://github.com/Microsoft/vcpkg.git 3. 光盘 .\vcpkg 4. .\bootstrap-vcpkg.bat 5. .\vcpkg.exe 安装openssl 6. .\vcpkg.exe 集成安装 完成以上步骤后,就可以直接在VS中使用opengl了。有关 vcpkg 的更多信息,请参阅此处:https://github.com/Microsoft/vcpkg 我现在卡在第 4 步,命令在 powershell 中不起作用 它说

块引用

.\bootstrap-vcpkg.bat : 术语“.\bootstrap-vcpkg.bat”未被识别为 cmdlet、函数、脚本的名称 文件或可运行的程序。检查名称的拼写,或者如果包含路径,请验证路径是否正确 然后再试一次。 在行:1 字符:1 + .\bootstrap-vcpkg.bat + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (.\bootstrap-vcpkg.bat:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

块引用

这里有什么问题?有什么办法可以解决这个问题?

【问题讨论】:

  • 如果你展示你所做的并解释它是如何不起作用的,你更有可能获得帮助。那将是一个更好的 StackOverflow 问题。
  • 我已经编辑了这个问题。我已经详细提到了这个问题
  • 这里有什么问题?您从错误的文件夹中运行了该命令。确保将 powershell 中的目录更改为包含 bootstrap-vcpkg.bat 的文件夹

标签: c++ visual-studio github vcpkg installation-package


【解决方案1】:

首先使用你可能想做的freeglut:

.\vcpkg.exe install freeglut 而不是.\vcpkg.exe install openssl

如果您这样做并将其与.\vcpkg.exe integrate install 结合使用,vcpkg 将自动将<vcpkgroot>/installed/<triplet>/include 文件夹包含到您在VS 中的包含文件夹中,并自动链接所有库<vcpkgroot>/installed/<triplet>/(debug/)lib/

我个人总是建议使用 CMake 工具链,因为某些预处理定义无法自动设置。

我还强烈建议您阅读 vcpkg 的 documentation,因为那里也解释了这些细节

【讨论】:

  • 你能给我一些关于如何使用 CMake 工具链的信息吗?我是新来的。所以有点困惑
  • 如果您的项目不使用 CMake 本身,则此处无事可做。如果您的项目是使用 CMake 构建的,只需通过 -DCMAKE_TOOLCHAIN_FILE= 将工具链添加到命令行调用或通过 GUI 进行设置。但这也在文档中进行了解释。 vcpkg.readthedocs.io/en/latest/examples/…
猜你喜欢
  • 1970-01-01
  • 2019-08-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-04
  • 2020-09-26
  • 1970-01-01
  • 2020-04-04
相关资源
最近更新 更多