Results 1 to 2 of 2

Thread: Qt 4.7.1 compiler issues

  1. #1
    Join Date
    Aug 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.7.1 compiler issues

    Hi everyone, this is my first post here, and subsequently my first attempt at using Qt to do anything.

    I'm really just trying to go through code examples to get a grip on the language/environment, etc. The tutorial I was using is on

    http://www.digitalfanatics.org/proje...chapter01.html

    OK, firstly, I am running windows 7, and I installed Qt from the open-source zip file since I have microsoft VS 2010 on my machine. Then I installed the plug-in for VS2010. When I run through examples in Qt Creator, those all run fine. When I try to compile these other examples from the command line, I run into some problems, which I am hoping some light can be shed upon.

    I created the *.h, *.cpp, and main.cpp files as presented in the link above, changing the QVBox to Q3Vbox in all places for the backwards compatibility. Also, in my path variable, I included the paths to the \bin and every directory in \include just to be sure. So, from the command line in my directory with these files I run

    qmake -project
    qmake
    mingw32-make

    since I have mingw32 (g++) set as my compiler. when I run the g++ compiler, I get the following error messages:

    $ mingw32-make
    C:/MinGW/bin/mingw32-make -f Makefile.Debug all
    mingw32-make[1]: Entering directory `C:/qt/4.7.1/joeexamples'
    g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
    DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -
    DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/Qt/4.7
    .1/include/QtCore' -I'c:/Qt/4.7.1/include/QtGui' -I'c:/Qt/4.7.1/include' -I'.' -
    I'c:/Qt/4.7.1/include/ActiveQt' -I'tmp/moc/debug_shared' -I'c:/Qt/4.7.1/mkspecs/
    win32-g++' -o tmp/obj/debug_shared/main.o main.cpp
    In file included from main.cpp:3:0:
    mywidget.h:4:20: fatal error: q3vbox.h: No such file or directorycompilation terminated.
    mingw32-make[1]: *** [tmp/obj/debug_shared/main.o] Error 1
    mingw32-make[1]: Leaving directory `C:/qt/4.7.1/joeexamples'
    mingw32-make: *** [debug-all] Error 2
    in red there, I'm not sure if this is my ONLY problem, but I can't see why it can't find the file?

    Thanks!


    Added after 10 minutes:


    Wow.. solved. If anyone experiences similar things, add this to your .pro file:

    QT += qt3support

    otherwise the qt3 libraries won't be included. Also, be sure to examine some of the objects you may get errors on.

    Cheers
    Last edited by joemcg; 12th August 2011 at 20:07.

  2. #2
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.7.1 compiler issues

    Hi,
    A bit strange... you have MSVC, but you are building with MingW. Why ? You can download Qt pre-build for MSVC as well (from Qt-Nokia downloads.

    There are Qt 4.x books available online, I would suggest using those instead of the older tutorials. See Free Qt4.x book

    Also, it is a LOT easier to use QtCreator when you are just starting with Qt. The free plugin for MSVC has only limited functionality, so you still have to figure some things out by yourself. Using Qt Creator, everything just works out-of-the-box. Then you can start using Qt immediately, instead of first having to struggle with the toolchain. After you get more familiar with Qt, you can still switch back to using Visual Studio if you want.

    Best regards,
    Marc

Similar Threads

  1. Qt Creator Parse compiler errors of a non gcc compiler
    By kiozen in forum Qt Tools
    Replies: 4
    Last Post: 4th July 2011, 02:34
  2. qt compiler
    By mrholsten in forum Newbie
    Replies: 5
    Last Post: 6th April 2011, 18:46
  3. msvc Compiler or mingw compiler
    By Ashutosh2k1 in forum Qt Programming
    Replies: 3
    Last Post: 14th February 2011, 09:33
  4. Strange compiler behaviour (compiler passes wrong argument)
    By SasaVilic in forum General Programming
    Replies: 2
    Last Post: 2nd November 2010, 12:36
  5. Compiler
    By CHeader in forum Qt Programming
    Replies: 3
    Last Post: 10th April 2008, 16:45

Tags for this Thread

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.