• 2133阅读
  • 2回复

关于qtcreator无法编译, make命令可以编译的问题 [复制链接]

上一主题 下一主题
离线ste731
 

只看楼主 倒序阅读 楼主  发表于: 2019-05-07
交叉编译工具已经安装配置路径如图:





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

只看该作者 1楼 发表于: 2019-05-08
linux环境下编译qt工程需要设置环境变量的,window下没搞过但原理应该也是一样的
离线ste731

只看该作者 2楼 发表于: 2019-05-13
回 topmanly 的帖子
topmanly:linux环境下编译qt工程需要设置环境变量的,window下没搞过但原理应该也是一样的 (2019-05-08 20:00) 

就是在linux环境下,环境变量已经设置过了,否则,使用make命令编译也不会成功。
快速回复
限100 字节
 
上一个 下一个