Results 1 to 2 of 2

Thread: Several errors during "Release build"

  1. #1
    Join Date
    Jul 2010
    Qt products
    Qt5 PyQt3 PyQt4
    Unix/X11 Windows Android

    Default Re: Several errors during "Release build"

    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...

    Qt Code:
    1. /home/david/Projects/Cpp/MyNote/main.cpp:-1: error: multiple definition of `main'
    2. /home/david/Projects/Cpp/MyNote/mainwindow.cpp:-1: error: multiple definition of `MainWindow::MainWindow(QWidget*)'
    3. /home/david/Projects/Cpp/MyNote/mainwindow.cpp:-1: error: multiple definition of `MainWindow::on_actionExit_triggered()'
    4. /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...

    Qt Code:
    1. /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.
    Last edited by tndave; 29th July 2018 at 16:56.

  2. #2
    Join Date
    Jul 2018
    Thanked 1 Time in 1 Post
    Qt products

    Default Re: Several errors during "Release build"

    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.

Similar Threads

  1. Replies: 0
    Last Post: 28th November 2016, 17:21
  2. Qt Creator Qt SDK, Remote Compiler "Build Failed: Errors in build"
    By strahlex in forum Qt Tools
    Replies: 0
    Last Post: 10th August 2011, 17:59
  3. Replies: 3
    Last Post: 15th February 2010, 18:27
  4. Replies: 3
    Last Post: 29th August 2009, 23:24
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.