Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

Changes between Version 5 and Version 6 of TBR/UserManual/Using_C_Plus_Plus


Ignore:
Timestamp:
06/22/07 04:47:11 (17 years ago)
Author:
Rsg
Comment:

/* Linking */

Legend:

Unmodified
Added
Removed
Modified
  • TBR/UserManual/Using_C_Plus_Plus

    v5 v6  
    2828
    2929On some targets/with some compilers "linking c++" is effectively "just adding -lstdc++" but on most others it is more. What confuses some users is "gcc ... -lstdc++" once having been worked with old gcc (IIRC, gcc < 4.0) on i386 targets.
     30
     31If you use the RTEMS Makefile Template ($TARGET/make/Templates/Makefile.leaf), this is the easy way to link properly (example from the Template):
     32
     33{{{
     34# The following links using C++ rules to get the C++ libraries.
     35# Be sure you BSP has a make-cxx-exe rule if you use this.
     36${ARCH}/xxx-your-program-here: ${OBJS} ${LINK_FILES}
     37        $(make-cxx-exe)
     38}}}
    3039= Global Object Construction and Destruction =
    3140