joemcg
12th August 2011, 19:07
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/projects/qt_tutorial/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
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/projects/qt_tutorial/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