PDA

View Full Version : Several errors during "Release build"



tndave
29th July 2018, 15:56
I am getting several errors during the release build of a app I am working with. Everything runs fine when compiling in debug mode, but once I switch to release mode I get the following...


/home/david/Projects/Cpp/MyNote/main.cpp:-1: error: multiple definition of `main'
/home/david/Projects/Cpp/MyNote/mainwindow.cpp:-1: error: multiple definition of `MainWindow::MainWindow(QWidget*)'
/home/david/Projects/Cpp/MyNote/mainwindow.cpp:-1: error: multiple definition of `MainWindow::on_actionExit_triggered()'
/home/david/Projects/Cpp/MyNote/mainwindow.cpp:-1: error: multiple definition of `MainWindow::on_actionNew_triggered()'

This is just a small part of what I am getting. There is much more than this. There are other "on_action" functions that give the same error. Also getting this...


/home/david/Projects/Cpp/MyNote/main.cpp:-1: error: multiple definition of `main' /home/david/Projects/Cpp/MyNote/main.cpp:-1: first defined here main.cpp

Also similar dealing with mainwindow.cpp. Anyone have any suggestions? I am almost done with the app but don't want to go any further until I get this fixed.

Many thanks for any assistance.

Added after 20 minutes:

Nevermind lol. I found the issue. My .pro file had main.cpp and mainwindow.cpp defined several times. Removed all but one of each and things seem to compile fine now.

Cobra91151
5th August 2018, 17:39
Hi! You can try to clean/run qmake and build the project in release mode. Also check your code, multiple definitions means that you have another main and so on.