Results 1 to 7 of 7

Thread: Configure dev-c++ with QT

  1. #1
    Join Date
    May 2006
    Posts
    32
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Question Configure dev-c++ with QT

    I install dev-c++ and then "QT open source with mingw".
    And,I select dev-cpp/bin as mingw directory in first step of the installation of QT.
    All goes ok.

    I add the qt/lib qt/include dirs to dev-cpp's compiler option.
    When I build the code snippet below.Link error.
    Qt Code:
    1. #include<QtGui/QApplication>
    2. #include<QtGui/QPushButton>
    3. int main(int argc,char* argv[])
    4. {
    5. QApplication app(argc,argv);
    6. //QPushButton hello("Hello World");
    7. //hello.resize(100,300);
    8. //hello.show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 
    errors:

    [Linker error] undefined reference to `_imp___ZN12QApplicationC1ERiPPc'
    [Linker error] undefined reference to `_imp___ZN12QApplication4execEv'
    [Linker error] undefined reference to `QApplication::~QApplication()'
    [Linker error] undefined reference to `QApplication::~QApplication()'
    ld returned 1 exit status

    build logs:

    Compiler: Default compiler
    Executing mingw32-g++.exe...
    mingw32-g++.exe "M:\实验\qtHello.cpp" -o "M:\实验\qtHello.exe" -I"M:\dev_tool\Dev-Cpp\include\c++" -I"M:\dev_tool\QT4\include" -L"M:\dev_tool\QT4\lib" -L"M:\dev_tool\Dev-Cpp\lib"
    C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccwRaaaa.o(.text+0x171):qtHello.cpp: undefined reference to `_imp___ZN12QApplicationC1ERiPPc'
    C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccwRaaaa.o(.text+0x17f):qtHello.cpp: undefined reference to `_imp___ZN12QApplication4execEv'
    C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccwRaaaa.o(.text+0x19d):qtHello.cpp: undefined reference to `QApplication::~QApplication()'
    C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccwRaaaa.o(.text+0x1c6):qtHello.cpp: undefined reference to `QApplication::~QApplication()'
    collect2: ld returned 1 exit status

    Execution terminated



    Thanks

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Configure dev-c++ with QT

    try

    #include<QApplication>
    #include<QPushButton>

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Configure dev-c++ with QT

    Quote Originally Posted by iGoo
    mingw32-g++.exe "M:\实验\qtHello.cpp" -o "M:\实验\qtHello.exe" -I"M:\dev_tool\Dev-Cpp\include\c++" -I"M:\dev_tool\QT4\include" -L"M:\dev_tool\QT4\lib" -L"M:\dev_tool\Dev-Cpp\lib"
    You didn't link your application with Qt libraries. Search the forum --- there were some threads about Dev C++.

  4. #4
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default Configure dev-c++ with QT

    Dev-C++ requires class browsing desactivated and
    in Project->Project Options->Makefile->Use Custom Makefile

    The makefile you generate from your .pro with Qt qmake :
    qmake -project // to generate the .pro
    qmake // to generate the custom makefile
    and then point to this makefile

  5. #5
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Configure dev-c++ with QT

    Custom makefile didn't worked for me! Looks like build targets are not the same...
    Current Qt projects : QCodeEdit, RotiDeCode

  6. #6
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default Configure dev-c++ with QT

    I compiled your application with Dev-Cpp and it works fine so it is the configuration.

    1. did you generate the custom makefile :
    in that directory qmake - project, qmake

    2. mak sure you compile within Dec-Cpp with this custom makefile

    3. do you have the environment variables correctly set up in configuration panel :
    PATH: C:\Qt\4.1.3\bin;C:\MinGW\bin
    QMAKESPEC: win32-g++
    QTDIR: C:\Qt\4.1.3
    Last edited by incapacitant; 29th May 2006 at 14:03. Reason: added info

  7. #7
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Configure dev-c++ with QT

    I've given up Dev-Cpp a long time ago...
    I now use command prompt to compile and my own text editor to do the rest
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. Replies: 2
    Last Post: 31st August 2011, 16:15
  2. missing qconfig.h during configure
    By hvengel in forum Installation and Deployment
    Replies: 2
    Last Post: 8th May 2006, 07:14
  3. configure, then what?
    By Morea in forum Installation and Deployment
    Replies: 9
    Last Post: 5th March 2006, 19:10
  4. Can't configure for Win32 MSVC .NET
    By saber850 in forum Installation and Deployment
    Replies: 8
    Last Post: 28th February 2006, 16:42

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.