c++ - 如何使用不同的 Visual Studio 版本处理一个 SFML-C++ 项目?
问题描述
我正在开发一个需要SFML(免费可移植库)和一些可以复制到 USB 棒/驱动器上的依赖项的 C++ 项目。
问题是我在家里使用 Visual Studio 2019并且经常在 uni/work 使用 Visual Studio 2013。
每当我尝试从另一个版本运行项目时,都会抛出异常和其他错误。唯一的解决办法是创建一个新项目并烦人地添加每个依赖项和 lib 文件夹,我绝对会 100% 积极避免不惜一切代价...
除了为每个 VS 版本制作两个单独的项目外,我如何使用不同版本的 Visual Studio 处理一个项目?
我尝试使用可移植的代码块 17.02 副本,但 IDE 使用起来不是很愉快,特别是因为我拥有 Visual Studio 密钥,其他学生也会在 Visual Studio 中查看代码。
这只是一些简单的窗口创建示例:
#include <SFML\Graphics.hpp>
using namespace sf;
int main()
{
RenderWindow Window;
Window.create(VideoMode(800, 800), "VS2013-VS2019Example");
while (Window.isOpen()) {
Event e;
while (Window.pollEvent(e)) {
if (e.type == Event::Closed) {
Window.close();
}
}
Window.clear();
Window.display();
}
}
I expected the program to create a new window, 800x800 with a title and no interception.
Starting the program will result in VS indicating that line 8, the line where window.create() is called, throws a Access violation reading location 0x000FFF exception at 0x0F15A5E3 (msvcp120.dll) in [project name].exe.
解决方案
推荐阅读
- python - 从本地设置的模块调用带有值的 Python 函数
- python - 用于 Youtube 的 Python Selenium Opera - 出现错误
- javascript - 如何区分 Javascript 中的列表和对象?
- java - 在java中使用文件IO来读写一个我自己的集合类
- firebase - 为什么 Firebase 需要 Google 密钥才能登录?
- r - 如何调整 Shiny 中生成的图形的图例
- c++ - 运行“make -j”时的构建问题-“je_malloc”属性指令被忽略
- curl - ubuntu 20.10 上的 curl 损坏 curl_url_set 未定义
- reactjs - 如何在 grpc-web 中使用 TLS?
- reactjs - 上传带有图片的表单formik