qt入门一

刚安装了qt,安装之后,结果如同学习其它软件一样不能“正常”的运行使用,可能是因为我没有正常的使用,所以qt没有正常的运行吧。

以下是遇到的一些问题,等解决后贴到这里。

在qt command prompt中输入mingw32-make后,失败,得到如下结果:

 

D:/Qt/4.7.1/mytest>mingw32-make
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `D:/Qt/4.7.1/mytest'
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"../includ
e/QtCore" -I"../include/QtGui" -I"../include" -I"." -I"../include/ActiveQt" -I"t
mp/moc/debug_shared" -I"../mkspecs/win32-g++" -o tmp/obj/debug_shared/main.o mai
n.cpp
main.cpp:11: error: stray '/241' in program
main.cpp:11: error: stray '/260' in program
main.cpp:11: error: stray '/241' in program
main.cpp:11: error: stray '/261' in program
main.cpp:5: error: 'argv' was not declared in this scope
main.cpp:5: error: expected primary-expression before 'char'
main.cpp:5: error: initializer expression list treated as compound expression
main.cpp:7: error: expected ',' or ';' before '{' token
mingw32-make[1]: *** [tmp/obj/debug_shared/main.o] Error 1
mingw32-make[1]: Leaving directory `D:/Qt/4.7.1/mytest'
mingw32-make: *** [debug-all] Error 2

 

没看明白是什么意思,正在google着~

 

晕菜了,真是悲剧,后来才发现原来安装的qt是qt-win-opensource-4.7.1-vs2008.exe,而且哦没有安装vs2008。所以编译什么的一直失败。原因应该是这个,同学安装了vs2008,运行可以成功。

发现这个错误以后,就把vs版本的换成了mingw版本的qt-win-opensource-4.2.2-mingw.exe。安装之后,把路径D:/Qt/mingw/bin和D:/Qt/4.2.2/bin加到环境变量中,之后qmake -project,qmake,make,然后运行成功了。

posted @ 2011-04-30 22:17  lawdong  Views(2602)  Comments(0Edit  收藏  举报
http://home.cnblogs.com/ing/