Results 1 to 1 of 1

Thread: Application compiling under QtCreator, but not from command line with pure qmake.

  1. #1
    Join Date
    Sep 2009
    Location
    Poland, Cracow
    Posts
    34
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application compiling under QtCreator, but not from command line with pure qmake.

    Hi,

    My projects compiles and runs fine from QtCreator, but when I build it from command line I get errors:
    Qt Code:
    1. /tmp/a/app/SQLiteStudio/../coreSQLiteStudio//libcoreSQLiteStudio.so: undefined reference to `QByteArray::realloc(int)'
    2. /tmp/a/app/SQLiteStudio/../coreSQLiteStudio//libcoreSQLiteStudio.so: undefined reference to `qHash(QString const&)'
    3. /tmp/a/app/SQLiteStudio/../coreSQLiteStudio//libcoreSQLiteStudio.so: undefined reference to `QString::fromAscii(char const*, int)'
    4. /tmp/a/app/SQLiteStudio/../coreSQLiteStudio//libcoreSQLiteStudio.so: undefined reference to `qt_message_output(QtMsgType, char const*)'
    5. /tmp/a/app/SQLiteStudio/../coreSQLiteStudio//libcoreSQLiteStudio.so: undefined reference to `QString::operator==(QString const&) const'
    6. /tmp/a/app/SQLiteStudio/../coreSQLiteStudio//libcoreSQLiteStudio.so: undefined reference to `QString::operator==(QLatin1String const&) const'
    7. /tmp/a/app/SQLiteStudio/../coreSQLiteStudio//libcoreSQLiteStudio.so: undefined reference to `QString::shared_null'
    8. /tmp/a/app/SQLiteStudio/../coreSQLiteStudio//libcoreSQLiteStudio.so: undefined reference to `QHashData::detach_helper2(void (*)(QHashData::Node*, void*), void (*)(QHashData::Node*), int, int)'
    9. /tmp/a/app/SQLiteStudio/../coreSQLiteStudio//libcoreSQLiteStudio.so: undefined reference to `QString::codecForCStrings'
    10. /tmp/a/app/SQLiteStudio/../coreSQLiteStudio//libcoreSQLiteStudio.so: undefined reference to `QString::free(QString::Data*)'
    11. collect2: error: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

    Note, that I have 3 qt versions installed in system:
    /usr/lib/qt/bin/qmake
    /opt/qt5/Qt5.2.0/5.2.0/gcc/bin/qmake
    /opt/qt5/Qt5.1.0/5.1.0/gcc/bin/qmake

    I ran /opt/qt5/Qt5.2.0/5.2.0/gcc/bin/qmake and then make. It compiled for a while just fine and then - at the final step - this came out.

    The application is made of one shared library and one final executable, that links to the shared library.
    Linker command was:
    Qt Code:
    1. g++ -Wl,-O1 -Wl,-rpath,/opt/qt5/Qt5.2.0/5.2.0/gcc -Wl,-rpath,/opt/qt5/Qt5.2.0/5.2.0/gcc/lib
    2. -o SQLiteStudio
    3. main.o mainwindow.o iconmanager.o dbtreemodel.o dbtreeitem.o dbtree.o
    4. dbtreeview.o actionentry.o dbdialog.o uiutils.o dbtreeitemdelegate.o dbtreeitemfactory.o
    5. sqleditor.o sqlitesyntaxhighlighter.o sqlquerymodel.o dblistmodel.o mdiarea.o statusfield.o
    6. tablewidget.o sqlqueryitem.o sqlqueryview.o sqlquerymodelcolumn.o sqlqueryitemdelegate.o
    7. extlineedit.o intvalidator.o widgetcover.o mdiwindow.o mdichild.o taskbar.o multieditor.o
    8. multieditorwidget.o widgetresizer.o multieditortext.o multieditornumeric.o numericspinbox.o
    9. multieditordatetime.o multieditordate.o multieditortime.o formview.o multieditorbool.o
    10. multieditorhex.o xbytearray.o qhexedit_p.o qhexedit.o commands.o multieditordialog.o
    11. completerwindow.o completermodel.o completeritemdelegate.o completerview.o
    12. searchtextdialog.o searchtextlocator.o tablewindow.o editorwindow.o sqltablemodel.o
    13. dataview.o tablestructuremodel.o tableconstraintsmodel.o columndialog.o
    14. columndialogconstraintsmodel.o extactioncontainer.o extaction.o tableprimarykeypanel.o
    15. constraintpanel.o tableforeignkeypanel.o tableuniquepanel.o tablepkanduniquepanel.o
    16. tablecheckpanel.o columncheckpanel.o constraintcheckpanel.o columnforeignkeypanel.o
    17. columnprimarykeypanel.o columnuniquepanel.o columnuniqueandnotnullpanel.o
    18. columnnotnullpanel.o columncollatepanel.o columndefaultpanel.o constraintdialog.o
    19. newconstraintdialog.o constrainttabmodel.o messagelistdialog.o viewwindow.o
    20. configdialog.o uiconfig.o indexdialog.o sqlview.o triggerdialog.o triggercolumnsdialog.o
    21. dbobjectdialogs.o moc_mainwindow.o moc_dbtreemodel.o moc_dbtreeitem.o
    22. moc_dbtree.o moc_dbtreeview.o moc_dbdialog.o moc_dbtreeitemdelegate.o
    23. moc_sqleditor.o moc_sqlitesyntaxhighlighter.o moc_sqlquerymodel.o moc_dblistmodel.o
    24. moc_mdiarea.o moc_statusfield.o moc_tablewidget.o moc_sqlqueryitem.o
    25. moc_sqlqueryview.o moc_sqlqueryitemdelegate.o moc_extlineedit.o moc_intvalidator.o
    26. moc_widgetcover.o moc_mdiwindow.o moc_mdichild.o moc_taskbar.o
    27. moc_multieditor.o moc_multieditorwidget.o moc_widgetresizer.o moc_multieditortext.o
    28. moc_numericspinbox.o moc_multieditordatetime.o moc_formview.o moc_multieditorhex.o
    29. moc_qhexedit_p.o moc_qhexedit.o moc_multieditordialog.o moc_completerwindow.o
    30. moc_completeritemdelegate.o moc_completerview.o moc_searchtextdialog.o
    31. moc_searchtextlocator.o moc_tablewindow.o moc_editorwindow.o moc_sqltablemodel.o
    32. moc_dataview.o moc_tablestructuremodel.o moc_tableconstraintsmodel.o
    33. moc_columndialog.o moc_columndialogconstraintsmodel.o moc_tableprimarykeypanel.o
    34. moc_constraintpanel.o moc_tableforeignkeypanel.o moc_tableuniquepanel.o
    35. moc_tablepkanduniquepanel.o moc_tablecheckpanel.o moc_columncheckpanel.o
    36. moc_constraintcheckpanel.o moc_columnforeignkeypanel.o moc_columnprimarykeypanel.o
    37. moc_columnuniquepanel.o moc_columnuniqueandnotnullpanel.o moc_columnnotnullpanel.o
    38. moc_columncollatepanel.o moc_columndefaultpanel.o moc_constraintdialog.o
    39. moc_newconstraintdialog.o moc_constrainttabmodel.o moc_messagelistdialog.o
    40. moc_viewwindow.o moc_configdialog.o moc_indexdialog.o moc_sqlview.o
    41. moc_triggerdialog.o moc_triggercolumnsdialog.o
    42. -L/tmp/a/app/SQLiteStudio/../coreSQLiteStudio/ -lcoreSQLiteStudio
    43. -L/opt/qt5/Qt5.2.0/5.2.0/gcc/lib -lQt5UiTools -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
    To copy to clipboard, switch view to plain text mode 

    All paths looks correct. I tried "ldd" on the libcoreSQLiteStudio.so requested here and it says:
    Qt Code:
    1. $ ldd libcoreSQLiteStudio.so.1.0.0
    2. linux-gate.so.1 (0xffffe000)
    3. libQt5Sql.so.5 => /opt/qt5/Qt5.2.0/5.2.0/gcc/lib/libQt5Sql.so.5 (0xb7599000)
    4. libQt5Core.so.5 => /opt/qt5/Qt5.2.0/5.2.0/gcc/lib/libQt5Core.so.5 (0xb70d0000)
    5. libpthread.so.0 => /lib/libpthread.so.0 (0xb7083000)
    6. libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6f9b000)
    7. libm.so.6 => /lib/libm.so.6 (0xb6f58000)
    8. libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb6f3c000)
    9. libc.so.6 => /lib/libc.so.6 (0xb6db1000)
    10. libicui18n.so.51 => /opt/qt5/Qt5.2.0/5.2.0/gcc/lib/libicui18n.so.51 (0xb6b8f000)
    11. libicuuc.so.51 => /opt/qt5/Qt5.2.0/5.2.0/gcc/lib/libicuuc.so.51 (0xb6a16000)
    12. libdl.so.2 => /lib/libdl.so.2 (0xb6a10000)
    13. libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb6a0e000)
    14. librt.so.1 => /lib/librt.so.1 (0xb6a05000)
    15. libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb68d7000)
    16. /lib/ld-linux.so.2 (0xb773c000)
    17. libicudata.so.51 => /opt/qt5/Qt5.2.0/5.2.0/gcc/lib/libicudata.so.51 (0xb538e000)
    To copy to clipboard, switch view to plain text mode 
    which is expected. This also matches to what libraries are linked in my problematic linker command, but it still fails

    Anyone has any idea why?

    The strangest thing is that it works just fine when compiled from QtCreator!


    Added after 1 38 minutes:


    Okay, never mind. I don't know what was wrong, but when I cleaned, rebuild with debug config, then cleaned and rebuild in release config (as it was initially) it works fine now.
    Last edited by googie; 22nd December 2013 at 23:50.

Similar Threads

  1. qmake: how to supply multiple variables via command-line?
    By eyeofhell in forum Qt Programming
    Replies: 1
    Last Post: 6th July 2014, 02:58
  2. Where is the command line for qmake commands?
    By Rakula in forum Installation and Deployment
    Replies: 1
    Last Post: 21st October 2010, 10:53
  3. Replies: 2
    Last Post: 28th May 2010, 09:16
  4. Replies: 2
    Last Post: 28th June 2009, 12:39
  5. Replies: 2
    Last Post: 7th July 2008, 08:44

Bookmarks

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.