GCC STM23 cannot find -lstdc++

zhzChose the C++ project incorrectly when create the new project.

The correct way is:

File–>Project–>C Project–>Project name–>Cross ARM GCC–>Tools chain path–>Finsh.

But the problem is that still don know how to solve the problem if the project was composed with c and cpp code.

Solution for CPP project

  1. download the libstdc++ from the followed link
    https://packages.debian.org/jessie/all/libstdc++-arm-none-eabi-newlib/download

  2. install

    sudo dpkg -i libstdc++-arm-none-eabi-newlib.deb
    

Solution for : undefined reference to `_exit’

/usr/lib/gcc/arm-none-eabi/4.8.2/../../../arm-none-eabi/lib/armv7-m/libg.a(lib_a-abort.o): In function `abort’:

/build/buildd/newlib-2.1.0/build/arm-none-eabi/armv7-m/newlib/libc/stdlib/../../../../../../newlib/libc/stdlib/abort.c:63: undefined reference to `_exit’

/usr/lib/gcc/arm-none-eabi/4.8.2/../../../arm-none-eabi/lib/armv7-m/libg.a(lib_a-signalr.o): In function `_kill_r’:

/build/buildd/newlib-2.1.0/build/arm-none-eabi/armv7-m/newlib/libc/reent/../../../../../../newlib/libc/reent/signalr.c:61: undefined reference to `_kill’

/usr/lib/gcc/arm-none-eabi/4.8.2/../../../arm-none-eabi/lib/armv7-m/libg.a(lib_a-signalr.o): In function `_getpid_r’:

/build/buildd/newlib-2.1.0/build/arm-none-eabi/armv7-m/newlib/libc/reent/../../../../../../newlib/libc/reent/signalr.c:96: undefined reference to `_getpid’

add the option to the linkder flags

-specs=nosys.specs
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章