第一次在一个图形界面qtopia2.2的设备上开发,使用手持机商家自带的cygwin和qt3.3.8,程序完成在cygwin(Windows下模拟linux的软件)编译和连接。
输入 qmake makeobu.pro TARGET=makeobu 来自动生成makefile 主要内容如下:
CC = arm-unknown-linux-gnu-gcc
CXX = arm-unknown-linux-gnu-g++
CFLAGS = -pipe -Wall -W -Os -DQT_NO_QWS_VFB -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -
DQTOPIA_TARGET=\"makeobu\" -DQTOPIA_TRTARGET=\"makeobu\" -DQT_NO_DEBUG
LFLAGS = (空的)
CXXFLAGS = -pipe -DQWS -fexceptions -fno-rtti -DtrUtf8=QString::fromUtf8 -Wall -W -Os -DQT_NO_QWS_VFB -
DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"makeobu\" -
DQTOPIA_TRTARGET=\"makeobu\" -DQT_NO_DEBUG
INCPATH = -I/opt/qtopia2.2/qtopia/mkspecs/linux-myarm-g++ -I. -I/opt/qtopia2.2/qtopia/include -
I../../../gui/qtopia-free-2.2.0-gcc3.3.6/qt2/include -I.ui/release-shared/ -I. -I.moc/release-
shared/
LINK = arm-unknown-linux-gnu-g++
LIBS = $(SUBLIBS) -L/opt/qtopia2.2/qtopia/lib -L/genvict/gui/qtopia-free-2.2.0-gcc3.3.6/qt2/lib -lqte
UICDECLS = .ui/release-shared/formmain.h
OBJECTS = .obj/release-shared/formmain.o
FORMS = formmain.ui
UICDECLS = .ui/release-shared/formmain.h
UICIMPLS = .ui/release-shared/formmain.cpp
SRCMOC = .moc/release-shared/moc_formmain.cpp
OBJMOC = .obj/release-shared/moc_formmain.o
DIST = ../../../gui/qtopia-free-2.2.0-gcc3.3.6/qtopia/src/projects.pri \
../../../gui/qtopia-free-2.2.0-gcc3.3.6/qtopia/src/ipk_groups.pri \
makeobu.pro
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
all: Makefile $(TARGET)
$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS)
mocables: $(SRCMOC)
uicables: $(UICDECLS) $(UICIMPLS)
然后输入make
编译成功
提示很多很多undefined reference to ‘’;
然后最后一个ld returned 1 exit status。网上说是相关函数没实现,但是我确实是实现了啊~~是不是自动生成的makefile有问题啊,跪求大牛指导
------解决方案--------------------
这个直接问手持机厂商会更快。
------解决方案--------------------
对于Qt应用程序来说,无需去修改qmake帮你生成的Makefile,可是修改补齐pro文件,qmake会根据pro文件来生成正确无误的makefile的。 仔细检查pro的LIBS,SOURCES等,齐不齐,是不是有落下的。
ld returned 1 exit status 是链接错误。检查Libs有没有不是arm-unknown-linux-gnu-gcc 编译的。