Results 1 to 4 of 4

Thread: undefined reference to `_imp___Z*****

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default undefined reference to `_imp___Z*****

    Qt 4.2.2 with MinGW 3.4.2 (make is GNU 3.8) on XPpro SP2:
    I'm trying a simple program that would connect through ODBC to my MSSQL200 server that runs on my machine;
    the C:\Qt\4.2.2\demos\sqlbrowser\release\sqlbrowser.ex e does it perfectly but i want to do my own;

    qmake -project and qmake -o Makefile -SQLTest.pro run Ok but after that the "make" first tells me: QtSql - no such file or directory and then after I insert in the Makefile.Debug the "-I"C:/Qt/4.2.2/include/QtSql" it returns a bunch of:

    "undefined reference to `_imp___Z*****QSqlDatabase'"

    here is my 2 source files:
    main.cpp:

    Qt Code:
    1. #include <QtGui>
    2. #include <QtSql>
    3. #include <QSqlDatabase>
    4. #include <QSqlError>
    5. #include <QSqlError>
    6.  
    7. #include "connection.h"
    8.  
    9. int main(int argc, char *argv[])
    10. {
    11. QApplication app(argc, argv);
    12. if (!createConnection()) {
    13. return 1;}
    14. return app.exec();
    15. }
    To copy to clipboard, switch view to plain text mode 

    and connection.h:

    Qt Code:
    1. #ifndef CONNECTION_H
    2. #define CONNECTION_H
    3.  
    4. #include <QMessageBox>
    5. #include <QSqlDatabase>
    6.  
    7. inline bool createConnection()
    8. {
    9.  
    10. QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
    11. db.setHostName("localhost");
    12. db.setDatabaseName("mydb");
    13. db.setUserName("sa");
    14. db.setPassword("password");
    15.  
    16. if (!db.open()) {
    17. QMessageBox::warning(0, QObject::tr("Database Connection Error"),
    18. db.lastError().text());
    19. return false;
    20. }
    21. return true;
    22. }
    23. #endif
    To copy to clipboard, switch view to plain text mode 

    make gives me exact same message even if i try to copy the entire contents of C:\Qt\4.2.2\demos\sqlbrowser\ into a different directory (how did it copile at install to begin with??)
    my path is: "PATH=C:\Qt\4.2.2\bin;C:\Qt\4.2.2\lib;C:\Qt\4.2.2\ include;C:\MinGW\bin;C:\WINDOWS\System32"

    any ideas?
    Last edited by wysota; 17th January 2007 at 22:06. Reason: missing [code] tags

Similar Threads

  1. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15
  2. Strange error while using Q3Canvas
    By Kapil in forum Newbie
    Replies: 13
    Last Post: 15th June 2006, 19:36
  3. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52
  4. undefined reference to fftw libraries
    By kmyadam in forum General Programming
    Replies: 2
    Last Post: 9th March 2006, 01:01
  5. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11

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
  •  
Qt is a trademark of The Qt Company.