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()'
/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()'
To copy to clipboard, switch view to plain text mode
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
/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
To copy to clipboard, switch view to plain text mode
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.
Bookmarks