简体   繁体   中英

How to exclude cpp files from project in Qt

I want to exclude a cpp file with main function from a qt project and run the project with another cpp file with main function in it. But when I remove (not Delete) cpp file, I encounter a linker error cause there is 2 main functions in my project. One in the removed cpp file and one in the cpp file I want to compile and run.

How can I implement excluding a file from project?

first do a Clean Project (to remove the old .obj files from the build folder)

then in your .pro file there is a section SOURCES just remove the filename from there and rerun qmake

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM