Results 1 to 10 of 10

Thread: qt4 compilation problem

  1. #1
    Join Date
    Feb 2007
    Posts
    42
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default qt4 compilation problem

    hi, i am new to using qt4...

    i have installed qt4 opensource edition and i have also installed ms visual studio 2005...

    i try to compile some source code {from the command line} using

    qmake -project

    qmake project_name.pro

    and i get varius compilation errors....

    The code that i try to compile is correct because, i basically try to run the examples from "C++ GUI Programming with Qt 4" book....what am i doing wrong, is there a possible conflict betweetn qt and ms visual studio??

    plz help!

  2. #2
    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: qt4 compilation problem

    Quote Originally Posted by aegis View Post
    is there a possible conflict betweetn qt and ms visual studio??
    Yes, the Open Source version for windows works only with MinGW (at least officially).

    http://www.qtcentre.org/forum/f-inst...2005-2889.html

  3. #3
    Join Date
    Feb 2007
    Posts
    42
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt4 compilation problem

    Quote Originally Posted by jacek View Post
    Yes, the Open Source version for windows works only with MinGW (at least officially).

    http://www.qtcentre.org/forum/f-inst...2005-2889.html
    but i dont want to use qt with visual studio...i just want to use qt,without uninstalling visual studio...

  4. #4
    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: qt4 compilation problem

    Quote Originally Posted by aegis View Post
    i just want to use qt,without uninstalling visual studio...
    Oh, I see... in such case there shouldn't be any problem. If you have MinGW installed and Qt knows where it is, it should be enough if you start "Qt 4.x.y Command Prompt" (there should be a link in Start menu) --- it will set your environment correctly.

  5. The following user says thank you to jacek for this useful post:

    Shoji (21st February 2007)

  6. #5
    Join Date
    Feb 2007
    Posts
    42
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt4 compilation problem

    unfortunatelly it doesn't work.....and get varius errors.....

  7. #6
    Join Date
    Feb 2007
    Posts
    42
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: qt4 compilation problem

    i installed qt4 on another computer with no visual studio, and finally i was able to build the hello qt program!!!

    now i am trying another example from the book C++ gui programming with Qt4 and it also gives me compilation errors...

    Qt Code:
    1. #include <QApplication>
    2. #include <QDialog>
    3. #include "ui_gotocelldialog.h"
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication app(argc, argv);
    7. Ui::GoToCellDialog ui;
    8. QDialog *dialog = new QDialog;
    9. ui.setupUi(dialog);
    10. dialog->show();
    11. return app.exec();
    12. }
    To copy to clipboard, switch view to plain text mode 

    i have named the main form as GoToCellDialogm, and although this program doesn't do anything, i expected to have no problems compiling it....

    Qt Code:
    1. C:\QT programming\test>make
    2. mingw32-make -f Makefile.Debug
    3. mingw32-make[1]: Entering directory `C:/QT programming/test'
    4. c:\Qt\4.2.2\bin\uic.exe test.ui -o ui_test.h
    5. g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runt
    6. ime-pseudo-reloc -Wl,-subsystem,windows -o "debug\test.exe" -L"c:\Qt\4.2.2\lib
    7. " -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
    8. c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0xd): In function `Z13qAtomicSe
    9. tPtrIP16QVectorTypedDataIPcEET_PVS4_S4_':
    10. C:/Qt/4.2.2/include/QtCore/../../src/corelib/tools/qvector.h: undefined referenc
    11. e to `std::string::size() const'
    12. c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x60):C:/Qt/4.2.2/include/QtCor
    13. e/../../src/corelib/tools/qvector.h: undefined reference to `std::string::operat
    14. or[](unsigned int) const'
    15. c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x9f):C:/Qt/4.2.2/include/QtCor
    16. e/../../src/corelib/tools/qvector.h: undefined reference to `std::string::operat
    17. or[](unsigned int) const'
    18. c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0xce):C:/Qt/4.2.2/include/QtCor
    19. e/../../src/corelib/tools/qvector.h: undefined reference to `std::string::operat
    20. or[](unsigned int) const'
    21. c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x10f): In function `WinMain':
    22. C:/Qt/4.2.2/src/winmain/qtmain_win.cpp:68: undefined reference to `__gxx_persona
    23. lity_sj0'
    24. c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x30b):C:/Qt/4.2.2/src/winmain/
    25. qtmain_win.cpp:105: undefined reference to `qMain(int, char**)'
    26. collect2: ld returned 1 exit status
    27. mingw32-make[1]: *** [debug\test.exe] Error 1
    28. mingw32-make[1]: Leaving directory `C:/QT programming/test'
    29. mingw32-make: *** [debug] Error 2
    To copy to clipboard, switch view to plain text mode 

    is the code wrong??
    Last edited by aegis; 21st February 2007 at 12:35. Reason: updated contents

  8. #7
    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: qt4 compilation problem

    These errors are really weird. Does it compile if you invoke "make -f Makefile.Release"?

    Did you compile the debug version of Qt libraries yourself?

  9. #8
    Join Date
    Feb 2007
    Location
    New Mexico, USA
    Posts
    1
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Lightbulb Re: qt4 compilation problem

    Quote Originally Posted by jacek View Post
    [. . . ]it should be enough if you start "Qt 4.x.y Command Prompt" (there should be a link in Start menu) --- it will set your environment correctly.
    The Readme that comes with Qt 4.2.2 Commercial version has the following paragraph:
    DEMOS AND EXAMPLES

    Once Qt is installed, we suggest that you take a look at the demos and
    examples to see Qt in action. Run the Qt Examples and Demos either by
    typing 'qtdemo' on the command line or through the desktop's Start
    menu. On Mac OS X, you can find it in /Developers/Applications/Qt.
    I just downloaded the Win commercial evaluation version 4.2.2 of Qt. Started the Tutorial and kept getting errors based on the environment variables not being set. I found this quote from Jacek to be a necessary step in getting the environment set up properly. Tutorial t1 doesn't seem to mention this tip, either. I'm glad Jacek mentioned this tip, which may be unnecessary to most people, but not to me.

    I suggest this Readme paragraph and the tutorial would be good places to state that the environment is set up by using the command-line option in the Start Menu. The way this paragraph reads now, it appears that going to Start/Run/Command would be acceptable; sadly, this is not the case.

    Thanks to Jacek. Glad you're here.

  10. #9
    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: qt4 compilation problem

    Quote Originally Posted by Shoji View Post
    I suggest this Readme paragraph and the tutorial would be good places to state that the environment is set up by using the command-line option in the Start Menu.
    Make sure you send that suggestion to the Trolls.

  11. #10
    Join Date
    Feb 2007
    Posts
    42
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt4 compilation problem

    Quote Originally Posted by jacek View Post
    These errors are really weird. Does it compile if you invoke "make -f Makefile.Release"?

    Did you compile the debug version of Qt libraries yourself?
    sorry i can't test your suggestion, because i formated the computer and made a clean installation of everything but visual studio....now i re-wrote the same code and it worked!!!

    i hope that i can now finish the book on qt4 without any problems...

    thanks again for your help!!!

Similar Threads

  1. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  2. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  3. Problem and solution about QSA 1.2.0 compilation
    By Dwarf007 in forum Installation and Deployment
    Replies: 5
    Last Post: 7th March 2006, 16:52
  4. Replies: 16
    Last Post: 7th March 2006, 15:57
  5. Compilation problem, don't know why
    By yellowmat in forum Newbie
    Replies: 6
    Last Post: 2nd March 2006, 15:36

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.