简体   繁体   English

如何使用 Visual Studio Code 从 Visual Studio 2019 构建、调试和运行现有的 C++ 解决方案 (.sln)?

[英]How do I use Visual Studio Code to build, debug and run existing C++ solution (.sln) from Visual Studio 2019?

I have an existing C++ solution which I have been building and running using Visual Studio 2019. I would like to build and run the application on Ubuntu using g++ and Visual Studio Code.我有一个现有的 C++ 解决方案,我一直在使用 Visual Studio 2019 构建和运行它。我想使用 g++ 和 Visual Studio Code 在 Ubuntu 上构建和运行应用程序。 What is the best way of achieving this?实现这一目标的最佳方法是什么? Most of the samples provided are building single.cpp file but my application consists of many.cpp files built into one application executable.提供的大多数示例都在构建 single.cpp 文件,但我的应用程序包含许多构建在一个应用程序可执行文件中的 .cpp 文件。

https://code.visualstudio.com/docs/cpp/config-linux How do I set up Visual Studio Code to compile C++ code? https://code.visualstudio.com/docs/cpp/config-linux 如何设置 Visual Studio Code 来编译 C++ 代码?

I have installed the https://github.com/fernandoescolar/vscode-solution-explorer extension but that only enables me to browse the C++ solution.我已经安装了https://github.com/fernandoescolar/vscode-solution-explorer扩展,但这只能让我浏览 C++ 解决方案。 How to build the solution and being able to debug and run the C++ application?如何构建解决方案并能够调试和运行 C++ 应用程序?

Any advice and insight is appreciated.任何建议和见解表示赞赏。

使用CMake并从.sln生成CMakeLists.txt并使用https://github.com/pavelliavonau/cmakeconverter cmake-converter -s MyProject.sln包含.vcxproj

In one of the sections, I provide information on how to build solution files in Visual Studio Code in Windows (I believe it is similar for other systems): https://stackoverflow.com/a/75110946/20707965在其中一个部分中,我提供了有关如何在 Windows 中的Visual Studio Code中构建解决方案文件的信息(我相信其他系统也类似): https://stackoverflow.com/a/75110946/20707965

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Visual Studio 2017 中无错误地打开 Visual Studio 2019 c++ 代码? - How do i open Visual Studio 2019 c++ code in Visual Studio 2017 without errors? 如何在Visual Studio 2015中调试现有的C ++源代码? - How do I debug existing C++ source code in Visual Studio 2015? Visual Studio 2019 拒绝构建解决方案 C++ - Visual Studio 2019 refusing to build solution C++ 如何在Visual Studio代码中构建和运行C ++代码? - How to build and run C++ code in Visual Studio Code? Visual Studio 2019 C++ 构建成功后运行 an.exe - Visual Studio 2019 C++ After Successed Build Run an .exe 如何将Visual Studio for Windows中制作的C ++解决方案转移到Visual Studio for Mac? - How do I transfer my C++ solution made in Visual Studio for Windows to Visual Studio for Mac? 如何阻止 Visual Studio 2019 在 C++ 中的块注释期间自动插入星号? - How do I stop Visual Studio 2019 from automatically inserting asterisk during a block comment in C++? 如何在Visual Studio Code中构建和运行C ++文件? - How can I build and run a C++ file in Visual Studio Code? 如何从 windows 计算机将 c++ 代码构建到 Visual Studio 2019 上的 a.dmg 文件而不是 a.exe 文件? - How to build c++ code into a .dmg file rather than a .exe file on visual studio 2019 from a windows computer? 如何在数组上使用运算符 L? (C++,Visual Studio 2019) - How to use operator L on array? (C++, Visual Studio 2019)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM