项目中创建了一个qrc,4.8.3编译时报如下错误:
mingw32-make debug
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `E:/QtWorkspace/CommentLinkButton'
d:\Developer\Qt\4.8.3\bin\uic.exe commentlinkbutton.ui -o ui_commentlinkbutton.h
g++ -c -g -Wall -Wextra -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I"d:\Developer\Qt\4.8.3\include\QtCore" -I"d:\Developer\Qt\4.8.3\include\QtGui" -I"d:\Developer\Qt\4.8.3\include" -I"d:\Developer\Qt\4.8.3\include\ActiveQt" -I"debug" -I"." -I"d:\Developer\Qt\4.8.3\mkspecs\default" -o debug\main.o main.cpp
g++ -c -g -Wall -Wextra -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I"d:\Developer\Qt\4.8.3\include\QtCore" -I"d:\Developer\Qt\4.8.3\include\QtGui" -I"d:\Developer\Qt\4.8.3\include" -I"d:\Developer\Qt\4.8.3\include\ActiveQt" -I"debug" -I"." -I"d:\Developer\Qt\4.8.3\mkspecs\default" -o debug\commentlinkbutton.o commentlinkbutton.cpp
D:\Developer\Qt\4.8.3\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I"d:\Developer\Qt\4.8.3\include\QtCore" -I"d:\Developer\Qt\4.8.3\include\QtGui" -I"d:\Developer\Qt\4.8.3\include" -I"d:\Developer\Qt\4.8.3\include\ActiveQt" -I"debug" -I"." -I"d:\Developer\Qt\4.8.3\mkspecs\default" -D__GNUC__ -DWIN32 commentlinkbutton.h -o debug\moc_commentlinkbutton.cpp
g++ -c -g -Wall -Wextra -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I"d:\Developer\Qt\4.8.3\include\QtCore" -I"d:\Developer\Qt\4.8.3\include\QtGui" -I"d:\Developer\Qt\4.8.3\include" -I"d:\Developer\Qt\4.8.3\include\ActiveQt" -I"debug" -I"." -I"d:\Developer\Qt\4.8.3\mkspecs\default" -o debug\moc_commentlinkbutton.o debug\moc_commentlinkbutton.cpp
bin\rcc.exe -name images images.qrc -o debug\qrc_images.cpp
process_begin: CreateProcess(NULL, bin\rcc.exe -name images images.qrc -o debug\qrc_images.cpp, ...) failed.
make (e=2): 系统找不到指定的文件。
mingw32-make[1]: *** [debug/qrc_images.cpp] Error 2
mingw32-make[1]: Leaving directory `E:/QtWorkspace/CommentLinkButton'
mingw32-make: *** [debug] Error 2
用4.8.0编译时报:
mingw32-make debug
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `E:/QtWorkspace/CommentLinkButton'
d:\Developer\Qt\4.8.0\bin\uic.exe commentlinkbutton.ui -o ui_commentlinkbutton.h
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"d:\Developer\Qt\4.8.0\include\QtCore" -I"d:\Developer\Qt\4.8.0\include\QtGui" -I"d:\Developer\Qt\4.8.0\include" -I"d:\Developer\Qt\4.8.0\include\ActiveQt" -I"debug" -I"." -I"d:\Developer\Qt\4.8.0\mkspecs\default" -o debug\main.o main.cpp
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"d:\Developer\Qt\4.8.0\include\QtCore" -I"d:\Developer\Qt\4.8.0\include\QtGui" -I"d:\Developer\Qt\4.8.0\include" -I"d:\Developer\Qt\4.8.0\include\ActiveQt" -I"debug" -I"." -I"d:\Developer\Qt\4.8.0\mkspecs\default" -o debug\commentlinkbutton.o commentlinkbutton.cpp
D:\Developer\Qt\4.8.0\bin\moc.exe -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"d:\Developer\Qt\4.8.0\include\QtCore" -I"d:\Developer\Qt\4.8.0\include\QtGui" -I"d:\Developer\Qt\4.8.0\include" -I"d:\Developer\Qt\4.8.0\include\ActiveQt" -I"debug" -I"." -I"d:\Developer\Qt\4.8.0\mkspecs\default" -D__GNUC__ -DWIN32 commentlinkbutton.h -o debug\moc_commentlinkbutton.cpp
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"d:\Developer\Qt\4.8.0\include\QtCore" -I"d:\Developer\Qt\4.8.0\include\QtGui" -I"d:\Developer\Qt\4.8.0\include" -I"d:\Developer\Qt\4.8.0\include\ActiveQt" -I"debug" -I"." -I"d:\Developer\Qt\4.8.0\mkspecs\default" -o debug\moc_commentlinkbutton.o debug\moc_commentlinkbutton.cpp
d:\Developer\Qt\4.8.0\bin\rcc.exe -name images images.qrc -o debug\qrc_images.cpp
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"d:\Developer\Qt\4.8.0\include\QtCore" -I"d:\Developer\Qt\4.8.0\include\QtGui" -I"d:\Developer\Qt\4.8.0\include" -I"d:\Developer\Qt\4.8.0\include\ActiveQt" -I"debug" -I"." -I"d:\Developer\Qt\4.8.0\mkspecs\default" -o debug\qrc_images.o debug\qrc_images.cpp
cc1plus.exe: out of memory allocating 134221823 bytes
mingw32-make[1]: *** [debug/qrc_images.o] Error 1
mingw32-make[1]: Leaving directory `E:/QtWorkspace/CommentLinkButton'
mingw32-make: *** [debug] Error 2
编译成外部二进制文件就没有问题。是不是qrc对资源文件的大小有要求?我的qrc中引用的图片文件为2M。