300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > 编译问题configure: error: C compiler cannot create executables

编译问题configure: error: C compiler cannot create executables

时间:2022-04-18 20:53:44

相关推荐

编译问题configure: error: C compiler cannot create executables

主机:centos

SDK:openwrt(linux内核4.4.14)

编译工具: mipsel-openwrt-linux-gnu-gcc 5.3.0

今天在移植一个tinydtls库的时候,出现了一个让人头疼的问题。从一个平台移植到openwrt平台,之前的编译没问题。

就是在进入tinydtls编译目录编译时,在check编译器时,有打印信息如下:

checking for mipsel-openwrt-linux-gnu-gcc... mipsel-openwrt-linux-gnu-gcc

checking whether the C compiler works... no

configure: error: in `/home/lee/mt7621_router/openwrt/build_dir/target-mipsel_1004kc+dsp_glibc-2.22/tinydtls/tinydtls':

configure: error: C compiler cannot create executables

See `config.log' for more details

为了获得更详细的信息查看了config.log,关键的信息如下:

configure:2684: checking whether the C compiler works

configure:2706: mipsel-openwrt-linux-gnu-gcc " -Wl,--hash-style=sysv -fPIC " conftest.c >&5

mipsel-openwrt-linux-gnu-gcc: error: ": No such file or directory

mipsel-openwrt-linux-gnu-gcc: error: ": No such file or directory

configure:2710: $? = 1

configure:2748: result: no

configure: failed program was:

| /* confdefs.h */

| #define PACKAGE_NAME "tinydtls"

| #define PACKAGE_TARNAME "tinydtls"

| #define PACKAGE_VERSION "0.8.2"

| #define PACKAGE_STRING "tinydtls 0.8.2"

| #define PACKAGE_BUGREPORT ""

| #define PACKAGE_URL ""

| /* end confdefs.h. */

|

| int

| main ()

| {

|

| ;

| return 0;

| }

configure:2753: error: in `/home/lee/mt7621_router/openwrt/build_dir/target-mipsel_1004kc+dsp_glibc-2.22/tinydtls/tinydtls':

configure:2755: error: C compiler cannot create executables

表面上看,是由于找不到mipsel-openwrt-linux-gnu-gcc交叉编译工具而造成的,但是排查了这个情况,因为传下来的PATH中有编译工具文件夹的路径。

找了好几篇文章看了一下,其中有一篇文章里说传到./configure中的CFLAGS,LIBS变量的问题,我试了试./configure --host=$(CROSS_COMPILE_PRIV) CFLAGS=

这样就可以顺利的生成Makefile了。然后我看了一下之前传下来的CFLAGS=" -Wl,--hash-style=sysv -fPIC ",就是因为这个导致的。

参考文章链接:

1./tyyhong/article/details/4266749

2./s/blog_533074eb01011yfv.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。