小编Nyc*_*aia的帖子

Visual Studio - X11:缺少 DISPLAY 环境变量

我正在使用 Visual Studio 2019 Enterprise 开发跨平台 (Windows / Linux) x64 GUI 应用程序。

在这个 2019 版本中,我们可以使用 Visual Studio 来调试平台(Windows - 本机)和 Linux - Ubuntu(在虚拟机中运行)。

您可以在这里看到它: https://devblogs.microsoft.com/cppblog/using-visual-studio-for-cross-platform-c-development-targeting-windows-and-linux/

因此,我按照本教程进行操作,并使用 Visual Studio 2019 IDE 在我的 Ubuntu 18 VM 中运行和调试此 GUI 示例应用程序。完美的!

现在,我尝试做我的自定义 GUI 应用程序:

为了实现跨平台 GUI,我使用 GLFW 3.3。

脚步:

  1. 创建 Visual Studio CMake 项目

  2. 编写C++代码和CMakeLists.txt

  3. 添加 VS 调试配置(Windows x64 和 Linux x64)

  4. 编译和链接(在VS Windows 和 Linux 目标上都可以)

  5. 运行(在 VS Windows 和 Linux 目标上都可以

但...

当我在 Windows 设置中运行它时,一切正常...出现 GLFW 窗口... …

linux cross-platform visual-studio visual-studio-2017 visual-studio-2019

5
推荐指数
1
解决办法
7959
查看次数

RapidXML:无法打印 - 编译时错误

我正在尝试使用 C++ 应用程序中的 RapidXML 库在控制台中打印 XML 文档数据。

\n\n

我正在关注此处的 RapidXML 手册链接,但出现编译时错误。

\n\n

这是我的 C++ 代码:

\n\n
#include <iostream>\n#include "rapidxml.hpp"\n#include "rapidxml_utils.hpp"\n#include "rapidxml_print.hpp"\n\nint main() {\n    rapidxml::file<> xmlFile("beerJournal.xml");\n    rapidxml::xml_document<> doc;\n    doc.parse<0>(xmlFile.data());\n\n    std::cout << doc;\n\n    return 0;\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

这是错误:

\n\n
rapidxml_print.hpp:115: error: \xe2\x80\x98print_children\xe2\x80\x99 was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]\n                 out = print_children(out, node, flags, indent);\n                       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~\n\nrapidxml_print.hpp:169: \xe2\x80\x98template<class OutIt, class Ch> OutIt rapidxml::internal::print_children(OutIt, const rapidxml::xml_node<Ch>*, int, int)\xe2\x80\x99 declared here, …
Run Code Online (Sandbox Code Playgroud)

c++ xml printf rapidxml cout

2
推荐指数
1
解决办法
746
查看次数