我正在使用 Visual Studio 2019 Enterprise 开发跨平台 (Windows / Linux) x64 GUI 应用程序。
在这个 2019 版本中,我们可以使用 Visual Studio 来调试平台(Windows - 本机)和 Linux - Ubuntu(在虚拟机中运行)。
因此,我按照本教程进行操作,并使用 Visual Studio 2019 IDE 在我的 Ubuntu 18 VM 中运行和调试此 GUI 示例应用程序。完美的!
现在,我尝试做我的自定义 GUI 应用程序:
为了实现跨平台 GUI,我使用 GLFW 3.3。
脚步:
创建 Visual Studio CMake 项目
编写C++代码和CMakeLists.txt
添加 VS 调试配置(Windows x64 和 Linux x64)
编译和链接(在VS Windows 和 Linux 目标上都可以)
运行(在 VS Windows 和 Linux 目标上都可以)
但...
当我在 Windows 设置中运行它时,一切正常...出现 GLFW 窗口... …
linux cross-platform visual-studio visual-studio-2017 visual-studio-2019
我正在尝试使用 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}\nRun Code Online (Sandbox Code Playgroud)\n\n这是错误:
\n\nrapidxml_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)