我正在为一个CMake项目使用C++。我正在尝试使用profile guided optimization,所以我还需要将命令行参数传递给二进制文件的Release模式版本。Visual Studio需要这个来创建一个性能概要文件。我已经为带有命令行参数的Debug模式二进制文件配置了一个Debug:
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"name": "MyProject",
"project": "CMakeLists.txt",
"projectTarget": "MyProject.exe",
"type": "default",
"args": [
"...", "..."
]
}
]
}当我切换到Release模式并选择MyProject启动项时,Visual Studio显示了以下错误消息:
Unable to start debugging. The startup project could not be launched.为什么它不这样工作呢?我也不能设置另一个配置文件并使Visual Studio在Release模式下识别它,但是在Debug模式下它工作得很好。
发布于 2019-02-24 15:23:12
我现在通过添加另一个条目成功地做到了这一点:
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"name": "MyProject",
"project": "CMakeLists.txt",
"projectTarget": "MyProject.exe",
"type": "default",
"args": ["...", "..."]
},
{
"name": "MyProject (Release\\MyProject.exe)",
"project": "CMakeLists.txt",
"projectTarget": "MyProject.exe (Release\\MyProject.exe)",
"type": "default",
"args": ["...", "..."]
}
]
}https://stackoverflow.com/questions/53726905
复制相似问题