QtCreator报错:You need to set an executable in the custom run configuration.

问题描述

QtCreator中cmake编译程序没问题,运行后报错:
QtCreator报错:You need to set an executable in the custom run configuration._第1张图片
因为该项目是用cmake来管理的,起初以为是没有设置可执行程序,查看CMakeLists.txt发现已经add_executable设置了

add_executable(test src/test.cpp)
target_link_libraries(test algorithm_lib)

原因分析:

通过Qt调试需要指定一个可执行程序的文件。


解决方案:

在Qt界面左边项目—>选择Qt编译的版本—>输入正确的可执行文件位置

QtCreator报错:You need to set an executable in the custom run configuration._第2张图片
QtCreator报错:You need to set an executable in the custom run configuration._第3张图片
可执行文件的位置根据自己的项目填写。

你可能感兴趣的:(C++,QT,软件安装,配置,bug,QtCreator,CMake,运行错误,可执行文件,项目配置)