Linux Ubuntu使用make编译失败,提示错误127和GCC权限不够
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux Ubuntu使用make编译失败,提示错误127和GCC权限不够相关的知识,希望对你有一定的参考价值。
简单的c语言程序,Makefile文件内容如下:
# Toolchain
TOOLCHAIN_TOP?=/opt/toolchain_mp1800
PATH:=$(PATH):$(TOOLCHAIN_TOP)/bin
export PATH
# Cross compiler
CROSS_COMPILE=mipsel-linux-uclibc-
CC=$(CROSS_COMPILE)gcc
STRIP=$(CROSS_COMPILE)strip
#
CFLAGS ?=-Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -fhonour-copts -fPIC
LDFLAGS?=
LDLIBS ?=
all: hello
hello.gdb: hello.o
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
hello: hello.gdb
@cp -f $^ $@
$(STRIP) -s $@
clean:
rm -f *.o hello *.gdb
执行结果如下:
root@ubuntu:~/hello# make
mipsel-linux-uclibc-gcc -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -fhonour-copts -fPIC -c -o hello.o hello.c
make: execvp: mipsel-linux-uclibc-gcc: 权限不够
make: *** [hello.o] 错误 127
root@ubuntu:~/hello#
求解!
赋予777权限后,运行,继续报错,如下:
cc1: error: /opt/toolchain_mp1800/bin/../lib/gcc/mipsel-linux-uclibc/4.1.2/../../../../mipsel-linux-uclibc/sys-include: not a directory
mipsel-linux-uclibc-gcc: error trying to exec '/opt/toolchain_mp1800/bin/../lib/gcc/mipsel-linux-uclibc/4.1.2/../../../../mipsel-linux-uclibc/bin/as': execv: Exec format error
make: *** [hello.o] 错误 1
不如你写一个简单的程序,把程序的代码、编译输出全部发上来,看看有没有人能帮你,本回答被提问者采纳 参考技术C 试试root下编译吧,如果还不行,那就是你这个编译器有问题
ubuntu 下用于 C++ 编译的 OpenCV 2.4.13 失败
【中文标题】ubuntu 下用于 C++ 编译的 OpenCV 2.4.13 失败【英文标题】:OpenCV 2.4.13 for C++ compilation under ubuntu fails 【发布时间】:2016-11-22 14:18:36 【问题描述】:我正在尝试在 ubuntu 上为 C++ 安装 openCV。我正在使用 this document 。但编译步骤失败。 make的日志如下:
$make
[ 0%] Built target opencv_core_pch_dephelp
[ 0%] Built target pch_Generate_opencv_core
[ 3%] Built target opencv_core
[ 4%] Built target opencv_ts_pch_dephelp
[ 4%] Built target pch_Generate_opencv_ts
[ 4%] Built target opencv_flann_pch_dephelp
[ 5%] Built target pch_Generate_opencv_flann
[ 5%] Built target opencv_flann
[ 5%] Built target opencv_imgproc_pch_dephelp
[ 5%] Built target pch_Generate_opencv_imgproc
[ 9%] Built target opencv_imgproc
[ 9%] Automoc for target opencv_highgui
[ 9%] Built target opencv_highgui_automoc
[ 9%] Automoc for target opencv_highgui_pch_dephelp
[ 9%] Built target opencv_highgui_pch_dephelp_automoc
[ 9%] Built target opencv_highgui_pch_dephelp
[ 9%] Built target pch_Generate_opencv_highgui
[ 9%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir /src/window_QT.cpp.o
In file included from /home/src/OpenCV/opencv-2.4.13/modules/highgui/src/window_QT.cpp:47:0:
/home/src/OpenCV/opencv-2.4.13/modules/highgui/src/window_QT.h:46:20: fatal error: QtOpenGL: No such file or directory
#include <QtOpenGL>
^
compilation terminated.
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_QT.cpp.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2
你能帮我解决这个编译问题吗?
【问题讨论】:
QtOpenGL 已安装 【参考方案1】:我通过运行避免了编译错误:
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_QT=ON -D WITH_OPENGL=ON ..
代替:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
【讨论】:
我还安装了这两个包:libqt5opengl5 libqt5opengl5-dev。 (参考:***.com/questions/31538560/…)以上是关于Linux Ubuntu使用make编译失败,提示错误127和GCC权限不够的主要内容,如果未能解决你的问题,请参考以下文章
linux使用make命令编译时出现啥提示证明make成功呢?
make menuconfig失败,提示:fatal error curses.h No such file or directory
linux Ubuntu14.04 make编译文件报错:No rule to make target `/usr/lib/libpython2.7.so', needed by `pytho
ubuntu 下用于 C++ 编译的 OpenCV 2.4.13 失败