Results 1 to 6 of 6

Thread: qDebug / qStringList - Problem

  1. #1
    Join Date
    Jun 2011
    Posts
    11
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default qDebug / qStringList - Problem

    Hi there,

    i tried to built a very simple application, just to test what SQL database plugins are installed:

    Qt Code:
    1. #include <QtCore/QCoreApplication>
    2. #include <QDebug>
    3. #include <QtSql/QSqlDatabase>
    4. #include <QStringList>
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. QCoreApplication a(argc, argv);
    9.  
    10. qDebug() << QSqlDatabase::drivers();
    11.  
    12.  
    13. return a.exec();
    14. }
    To copy to clipboard, switch view to plain text mode 

    This is all the code i've written. I know that this code worked in former versions of Qt, but now, it doesn't anymore. When I try to compile, i get this "symbol(s) not found for architecture x86_64" error.

    Here's the complete output:

    Qt Code:
    1. make: Entering directory `/.../MyProject-build-Desktop-Debug'
    2. cd subProject/ && /usr/bin/make -f Makefile
    3. make[1]: Entering directory `/.../My-build-Desktop-Debug/subProject'
    4. g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o dsp_Server main.o -F/Library/Frameworks -L/Library/Frameworks -framework QtCore
    5. Undefined symbols for architecture x86_64:
    6. "QSqlDatabase::drivers()", referenced from:
    7. _main in main.o
    8. ld: symbol(s) not found for architecture x86_64
    9. collect2: ld returned 1 exit status
    10. make[1]: *** [dsp_Server] Error 1
    11. make[1]: Leaving directory `/.../MyProject-build-Desktop-Debug/subProject'
    12. make: Leaving directory `/.../MyProject-build-Desktop-Debug'
    13. make: *** [subProject-make_default] Error 2
    14. 17:38:12: The process "/usr/bin/make" exited with code 2.
    15. Error while building/deploying project MyProject (target: Desktop)
    16. When executing step 'Make'
    To copy to clipboard, switch view to plain text mode 

    I'm using Qt 4.8.2 under OS X 10.8.2. Can anybody help?

    Thanks,
    Markus

    EDIT: Sorry for misfitting title... Before this problem occured, i had problems because i forgot to add the #include <QStringList> line (which also wasn't necessary the last time i used Qt)...
    Last edited by EMKAH; 18th November 2012 at 17:02. Reason: updated contents

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qDebug / qStringList - Problem

    how did you build Qt? with g++ and -arch x86_64?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qDebug / qStringList - Problem

    Not sure.. but looks like 32bit, 64 bit problem ..may be. create the project file .pro freshly .. just a suggestion ...
    "Behind every great fortune lies a crime" - Balzac

  4. #4
    Join Date
    Jun 2011
    Posts
    11
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: qDebug / qStringList - Problem

    Quote Originally Posted by amleto View Post
    how did you build Qt? with g++ and -arch x86_64?
    I installed the ready-to-use dmg image.

    Not sure.. but looks like 32bit, 64 bit problem ..may be. create the project file .pro freshly .. just a suggestion ...
    This is my .pro file:

    Qt Code:
    1. QT += core
    2.  
    3. QT -= gui
    4.  
    5. TARGET = subProject
    6. CONFIG += console
    7. CONFIG -= app_bundle
    8.  
    9. TEMPLATE = app
    10.  
    11.  
    12. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 

    When I add the line
    Qt Code:
    1. CONFIG -= x86_64
    To copy to clipboard, switch view to plain text mode 
    , it still throws the same error message (I cleaned everything before).

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qDebug / qStringList - Problem

    Looks like you are missing the sql module in your QT config line

    QT += sql

    Cheers,
    _

  6. The following user says thank you to anda_skoa for this useful post:

    EMKAH (19th November 2012)

  7. #6
    Join Date
    Jun 2011
    Posts
    11
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: qDebug / qStringList - Problem

    *...* Damn. I tried this with QT += network already...

    Thanks A LOT!!! This did cost me over 3 hours of frustration...

Similar Threads

  1. Problem with QT 4.6 qDebug and QString.
    By weaver4 in forum Newbie
    Replies: 7
    Last Post: 18th March 2013, 12:15
  2. QStringList problem :/
    By hakermania in forum Qt Programming
    Replies: 9
    Last Post: 17th August 2010, 13:55
  3. qstringlist problem
    By stella1016 in forum Qt Programming
    Replies: 4
    Last Post: 17th December 2009, 09:16
  4. QStringList scope problem
    By ht1 in forum Qt Programming
    Replies: 5
    Last Post: 30th November 2007, 19:44
  5. Replies: 7
    Last Post: 2nd June 2006, 12:48

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.