c++ - 在Visual Studio中创建Linux控制台应用程序时遇到问题

标签 c++ linux visual-studio

我正在尝试在Visual Studio中创建一个C++ Linux控制台应用程序,但是到目前为止,它的表现很奇怪。创建后,我收到以下警告/错误消息:

warning : Platform '[ARM64, 0]' referenced in the project file 'ConsoleApplication4' cannot be found.

warning : Platform '[ARM, 0]' referenced in the project file 'ConsoleApplication4' cannot be found.

warning : Platform '[x64, 0]' referenced in the project file 'ConsoleApplication4' cannot be found.

warning : Platform '[x86, 0]' referenced in the project file 'ConsoleApplication4' cannot be found.

error : Designtime build failed for project '' configuration 'Debug|x64'. IntelliSense might be unavailable. Check *.designtime.log files in your %TEMP% directory.


当我检查%TEMP%目录中的日志文件时,看到以下错误:

error MSB4057: The target "GetClCommandLines" does not exist in the project.

error MSB4057: The target "GetProjectDirectories" does not exist in the project.


我还看到了一些其他问题,这些错误消息都包含与更改项目属性有关的类似错误消息,但是当我在Visual Studio中右键单击该项目并单击“属性”时,会出现一个弹出窗口,指出没有可供选择的属性页。
我也看到过讨论对.csproj文件进行编辑的问题,但是我的项目仅包含.vcxproj文件(我怀疑是因为这是Linux项目?)。此外,我希望在解决方案资源管理器中的项目名称后看到“(Linux)”,但它不存在。解决方案资源管理器也没有列出项目下的main.cpp文件,尽管它存在于项目目录的磁盘上(按代码,它在main函数内包含默认的printf语句,并包含cstudio的文件) )。几乎就像Visual Studio无法将项目识别为Linux控制台应用程序一样,但是我不确定如何使其能够被识别。
我已在Visual Studio 2017和Visual Studio 2019上尝试过此操作。我已使用Visual Studio Installer程序来确保安装了以下工作负载:
Visual Studio核心编辑器
.NET桌面开发
使用C++进行桌面开发
使用C++进行Linux开发
我尝试修复每个安装以及完全卸载/重新安装。我还为Linux启用了Windows子系统,安装了最新的.NET开发人员工具,并在系统上安装了PowerShell。我想念什么?

最佳答案

您应该在计算机上安装Windows Powershell

关于c++ - 在Visual Studio中创建Linux控制台应用程序时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62523300/

相关文章:

c++ - 理解指向函数的指针的问题

c++ - 由于 LLVM 错误,Xcode 无法编译

c++ - C++中通过指针给变量赋值

linux - 使用 shell 脚本和 BC

linux - 使用 Linux 可加载内核模块拦截系统调用(劫持)

c++ - 变量在调用 lambda 之前被销毁

c++ - 在 Linux 上使用 CMake 时,如何告诉 PVS-Studio 忽略第三方库中的所有文件

c# - 在设置中使用自己的枚举

visual-studio - Visual Studio 任务列表

C++ #define 预处理器