c++ - 通过带有VS2019问题的WSL在Linux中编译控制台C++源代码
问题描述
在 Ubuntu WSL 中安装 g++ gdb 包后,我尝试通过 VS2019 在 WSL Linux 上编译我的 C++ 源代码(简单的 hello world),我可以调试代码并获取有关 vs2019 env 的信息,但是当尝试构建它时,我得到以下错误(可能是手册这个远程 WSL Linux 编译如何工作)
Object reference not set to an instance of an object.
//#include <string>
//#include <vector>
//#include <algorithm>
//#include <cmath>
using namespace std;
inline void keep_window_open() { char c; cin >> c; }
int main()
{
cout << "hello from ConsoleApplicationC__!\n";
keep_window_open();
return 0;
}```
解决方案
推荐阅读
- javascript - 如何让程序等待一个函数在 Node 中完成运行?
- java - 如何在android中制作圆形的相机预览?
- python - 未找到 Python 容器中的 Web 抓取
- javascript - 将 firebase 数组中的每个值渲染到
- 使用 ReactJS
- mysql - 在实时站点上通过 Golang 连接到 Cloud SQL (MySQL)
- php - 尝试安装 int 扩展 macOS Catalina 和 PHP 7.4.10
- c# - PostSharp 不能从 TargetMembers 中排除方面
- javascript - 左侧赋值无效
- angular - file.html 中的 Angular 插入服务
- ios - 如何将步进值传递给 ViewController?