首页| 论坛| 消息

标题:【提问】请教一个MinGW下link出错的问题
作者:yoke_wolf
日期:2006-01-05 21:36
内容:

刚用QT,遇到了问题,翻了以前的帖子,无果。所以开帖请教
环境:
windows 2k
qt-win-opensource-4.1.0-mingw.exe
MinGW-3.2.0
MSYS-1.0.10
mingw32-make-3.80.0-3
Designer 简单拖了个UI, uic->qmake->make,出错
出错信息如下:
$ make
make -f Makefile.Debug
make[1]: Entering directory `/e/yoke/work/qt/first'
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,windows -o "debug\first.exe" -L"D:\soft\devtools\SDK\QtForMinGW\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
D:\soft\devtools\SDK\QtForMinGW\lib/libqtmaind.a(qtmain_win.o)(.text+0xd): In function `Z16q_atomic_set_ptrPVvPv':
D:/soft/devtools/SDK/QtForMinGW/include/QtCore/../../src/corelib/thread/qatomic.h: undefined reference to `std::string::size() const'
D:\soft\devtools\SDK\QtForMinGW\lib/libqtmaind.a(qtmain_win.o)(.text+0x60):D:/soft/devtools/SDK/QtForMinGW/include/QtCore/../../src/corelib/thread/qatomic.h: undefined reference to `std::string::operator[](unsigned int) const'
D:\soft\devtools\SDK\QtForMinGW\lib/libqtmaind.a(qtmain_win.o)(.text+0x9f):D:/soft/devtools/SDK/QtForMinGW/include/QtCore/../../src/corelib/thread/qatomic.h: undefined reference to `std::string::operator[](unsigned int) const'
D:\soft\devtools\SDK\QtForMinGW\lib/libqtmaind.a(qtmain_win.o)(.text+0xce):D:/soft/devtools/SDK/QtForMinGW/include/QtCore/../../src/corelib/thread/qatomic.h: undefined reference to `std::string::operator[](unsigned int) const'
D:\soft\devtools\SDK\QtForMinGW\lib/libqtmaind.a(qtmain_win.o)(.text+0x10f): In function `WinMain':
D:/soft/devtools/SDK/QtForMinGW/src/winmain/qtmain_win.cpp:68: undefined reference to `__gxx_personality_sj0'
D:\soft\devtools\SDK\QtForMinGW\lib/libqtmaind.a(qtmain_win.o)(.text+0x30b):D:/soft/devtools/SDK/QtForMinGW/src/winmain/qtmain_win.cpp:105: undefined reference to `qMain(int, char**)'
collect2: ld returned 1 exit status
make[1]: *** Error 1
make[1]: Leav ..


#1 [XChinux 01-05 21:47]
看样子是路径设置的不正确。
include路径里找不到std::string
#2 [XChinux 01-05 21:47]
如果你用g++编译一个简单的C++程序而也通不过的话,说明就是路径不正确。你试试。
#3 [yoke_wolf 01-06 09:35]
我开始也想到了这个
我试过把sgi stl直接放在d:/sgi_stl下
然后make -I /d/sgi_stl
但问题依旧呀
是不是不能这样加搜索路径
#4 [XChinux 01-06 10:11]
还有include路径,不光是ld路径
#5 [yoke_wolf 01-06 12:00]
先谢谢了
这里说的....具体要怎么设?
我makefile直接改这样都不行:
CC = gcc
CXX = g++
LEX = flex
YACC = byacc
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
CFLAGS = -g -g -Wall $(DEFINES)
CXXFLAGS = -g -g -frtti -fexceptions -Wall $(DEFINES)
LEXFLAGS =
YACCFLAGS = -d
INCPATH = -I"D:/soft/devtools/SDK/QtForMinGW/include/QtCore" -I"D:/soft/devtools/SDK/QtForMinGW/include/QtGui" -I"D:/soft/devtools/SDK/QtForMinGW/include" -I"." -I"D:/soft/devtools/SDK/QtForMinGW/include/ActiveQt" -I"debug" -I"." -I"D:/soft/devtools/SDK/QtForMinGW/mkspecs/win32-g++" -I"D:/SGI_STL"
LINK = g++
LFLAGS = -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,windows
LIBS = -L"d:\SGI_STL" -L"D:\soft\devtools\SDK\QtForMinGW\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
QMAKE = qmake
IDC = D:\soft\devtools\SDK\QtForMinGW\bin\idc.exe
..........

<< 1 2 >> (1/2)

回复 发表
主题 版块