查看完整版本: [-- 关于qtcreator无法编译, make命令可以编译的问题 --]

QTCN开发网 -> Qt嵌入式开发 -> 关于qtcreator无法编译, make命令可以编译的问题 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

ste731 2019-05-07 13:35

关于qtcreator无法编译, make命令可以编译的问题

交叉编译工具已经安装配置路径如图:

[attachment=20278][attachment=20279][attachment=20280]



Build—>run qmake 没有问题:
15:00:31: Running steps for project untitled_new1...
15:00:31: Starting: "/opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake" /mnt/hgfs/qt_vmshare/untitled_new1/untitled_new1.pro -r -spec linux-oe-g++ CONFIG+=debug
15:00:32: The process "/opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake" exited normally.
15:00:32: Elapsed time: 00:01.

Build—> Buildall 编译出错:
15:05:43: Running steps for project untitled_new1...
15:05:43: Configuration unchanged, skipping qmake step.
15:05:43: Starting: "/usr/bin/make"
c -pipe  -g -DLINUX=1 -DEGL_API_FB=1 -Wall -W -D_REENTRANT -fPIE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -I. -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5 -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I. -o main.o main.cpp
make: c: Command not found
Makefile:709: recipe for target 'main.o' failed
c -pipe  -g -DLINUX=1 -DEGL_API_FB=1 -Wall -W -D_REENTRANT -fPIE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -I. -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5 -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I. -o widget.o widget.cpp
Makefile:845: recipe for target 'widget.o' failed
make: [main.o] Error 127 (ignored)
make: c: Command not found
make: [widget.o] Error 127 (ignored)
c -pipe  -g -DLINUX=1 -DEGL_API_FB=1 -Wall -W -D_REENTRANT -fPIE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -I. -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5 -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -I/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I. -o moc_widget.o moc_widget.cpp
Makefile:848: recipe for target 'moc_widget.o' failed
o untitled_new1 main.o widget.o moc_widget.o   -L/opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2 -lEGL -lGAL -lpthread
Makefile:202: recipe for target 'untitled_new1' failed
make: c: Command not found
make: [moc_widget.o] Error 127 (ignored)
make: o: Command not found
make: [untitled_new1] Error 127 (ignored)
15:05:43: The process "/usr/bin/make" exited normally.
15:05:43: Elapsed time: 00:00.

如果在工程目录使用:make命令编译程序。也是没有问题的,可以生产可执行文件。

使用qtcreator编译就会出错,是什么原因。






topmanly 2019-05-08 20:00
linux环境下编译qt工程需要设置环境变量的,window下没搞过但原理应该也是一样的

ste731 2019-05-13 09:15
topmanly:linux环境下编译qt工程需要设置环境变量的,window下没搞过但原理应该也是一样的 (2019-05-08 20:00) 

就是在linux环境下,环境变量已经设置过了,否则,使用make命令编译也不会成功。


查看完整版本: [-- 关于qtcreator无法编译, make命令可以编译的问题 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled