编译Ralink SDK时碰到的奇怪错误(undefined reference to `main')的解决办法
2013-11-12 13:35
651 查看
编译到RT288x_SDK/source/user/iptables-1.4.10出错:
libtool: link: /opt/buildroot-gcc342/bin/mipsel-linux-uclibc-gcc libiptc/.libs/libip4tc.so extensions/libext4.a ./.libs/libxtables.so -lm
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/lib/crt1.o: In function `__start':crt1.S:(.text+0x1c): undefined reference to `main'
很是郁闷,google、baidu上都是众说纷纭,没有一个实质性的解决办法。
后来经高人指点,让我看看是不是ubuntu的bash、dash的问题。
到网上一查,还真是这个问题!!
Ubuntu的 shell 默认安装的是 dash,而不是 bash。
运行以下命令查看 sh 的详细信息,确认 shell 对应的程序是哪个:
$ls -al /bin/sh
dash 比 bash 更轻,更快。但 bash 却更常用。
如果一些命令、脚本等总不能正常执行,有可能是 dash 的原因。
比如编译 Android 源代码的时候,如果使用 dash,则有可能编译出错,或者编译的系统不能启动。
通过以下方式可以使 shell 切换回 bash:
$sudo dpkg-reconfigure dash
然后选择 no 或者 否 ,并确认。
这样做将重新配置 dash,并使其不作为默认的 shell 工具。
也可以直接修改 /bin/sh 链接文件,将其指定到 /bin/bash:
$sudo ln -fs /bin/bash /bin/sh
libtool: link: /opt/buildroot-gcc342/bin/mipsel-linux-uclibc-gcc libiptc/.libs/libip4tc.so extensions/libext4.a ./.libs/libxtables.so -lm
/opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/lib/crt1.o: In function `__start':crt1.S:(.text+0x1c): undefined reference to `main'
很是郁闷,google、baidu上都是众说纷纭,没有一个实质性的解决办法。
后来经高人指点,让我看看是不是ubuntu的bash、dash的问题。
到网上一查,还真是这个问题!!
Ubuntu的 shell 默认安装的是 dash,而不是 bash。
运行以下命令查看 sh 的详细信息,确认 shell 对应的程序是哪个:
$ls -al /bin/sh
dash 比 bash 更轻,更快。但 bash 却更常用。
如果一些命令、脚本等总不能正常执行,有可能是 dash 的原因。
比如编译 Android 源代码的时候,如果使用 dash,则有可能编译出错,或者编译的系统不能启动。
通过以下方式可以使 shell 切换回 bash:
$sudo dpkg-reconfigure dash
然后选择 no 或者 否 ,并确认。
这样做将重新配置 dash,并使其不作为默认的 shell 工具。
也可以直接修改 /bin/sh 链接文件,将其指定到 /bin/bash:
$sudo ln -fs /bin/bash /bin/sh
相关文章推荐
- 编译Ralink SDK时碰到的奇怪错误(undefined reference to `main')的解决办法
- 编译Ralink SDK时碰到的奇怪错误(undefined reference to `main')的解决办法
- 编译Ralink SDK时碰到的奇怪错误(undefined reference to `main')的解决办法
- 编译linux 内核时:decompress.c:(.text+0x25c4): undefined reference to `error'的解决办法
- 编译错误----undefined reference to 'pthread_create'问题解决
- sqlite3 交叉编译 undefined reference to `fdatasync' 错误解决
- 解决webrtc2sip编译出现错误undefined reference to symbol 'dlopen@@GLIBC_2.1'
- 解决gcc 编译时报错"undefined reference to 'main'" 问题
- Qt编译错误:undefinedreferenceto`vtable for 。。。。'的解决
- 编译静态expect现undefined reference to `openpty' 错误解决方法
- GCC编译uboot出现(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0'错误的解决办法
- undefined reference to `__gnu_mcount_nc'的解决 在编译内核时出现了如下错误:
- php编译时undefined reference to `libiconv_open'解决办法
- 编译错误undefined reference to `dlsym' 的解决方法
- error:undefined reference to `coloured_LED_init'及相关错误时的解决办法!
- FreeBSD下编译Fontconfig时提示src/.libs/libfontconfig.so: undefined reference to `xmlCreatePushParserCtxt' 的解决办法
- 编译QT时出现lib/libQtGui.so: undefined reference to `ts_read_raw'的解决办法
- PHP 5.3.10 编译安装时出现 undefined reference to `libiconv' 错误的解决方法
- linux 编译中required file `./ltmain.sh' not found 错误的解决办法
- 出现undefined reference to `forkpty' 错误解决方法