QT6 “Files are not automatically added to the CMakeLists.txt file of the CMake project.”

 

找到 cmakelists.txt 打开,在如下位置添加就可以了。

set(PROJECT_SOURCES
        main.cpp
        mainwindow.cpp
        mainwindow.h
        mainwindow.ui
        dialog.h     //这是后来添加的对话框文件
        dialog.cpp  //
        dialog.ui    //

)


版权声明:本文为wangz76原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。