https://gcc.gnu.org/ml/gcc-help/2009-10/msg00320.html
JJ <alchemistmba@gmail.com> writes:
> I get undefined references to these two symbols while linking:
>
> _aeabi_unwind_cpp_pr1
> __cxa_end_cleanup
>
>
> The command I'm using is:
> cross-gnueabi-g++ -static -nostartfiles -nodefaultlibs -nostdlib -T
> temp.ld -o standalone_program start.o abc.o xyz.o -lgcc -lc
> -L/tools/arm/gnu_crosstools/arm/lib/gcc/arm-linux-gnueabi/4.3.2/
_aeabi_unwind_cpp_pr1 is normally defined in libgcc. If the undefined
reference is coming from libc, then you need to use -lgcc -lc -lgcc
(and, yes, sometimes you need -lgcc -lc -lgcc -lc -lgcc, which you can
also write as -Wl,--start-group,-lgcc,-lc,--end-group).
__cxa_end_cleanup is normally defined lib libsupc++. Since you are
linking C++ code with -nodefaultlibs, you probably need an explicit
-lsupc++.
Ian
++++++++++++++++++++
阅读(64) | 评论(0) | 转发(0) |
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
JJ <alchemistmba@gmail.com> writes:
> I get undefined references to these two symbols while linking:
>
> _aeabi_unwind_cpp_pr1
> __cxa_end_cleanup
>
>
> The command I'm using is:
> cross-gnueabi-g++ -static -nostartfiles -nodefaultlibs -nostdlib -T
> temp.ld -o standalone_program start.o abc.o xyz.o -lgcc -lc
> -L/tools/arm/gnu_crosstools/arm/lib/gcc/arm-linux-gnueabi/4.3.2/
_aeabi_unwind_cpp_pr1 is normally defined in libgcc. If the undefined
reference is coming from libc, then you need to use -lgcc -lc -lgcc
(and, yes, sometimes you need -lgcc -lc -lgcc -lc -lgcc, which you can
also write as -Wl,--start-group,-lgcc,-lc,--end-group).
__cxa_end_cleanup is normally defined lib libsupc++. Since you are
linking C++ code with -nodefaultlibs, you probably need an explicit
-lsupc++.
Ian
++++++++++++++++++++
相关热门文章
给主人留下些什么吧!~~
评论热议