This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C++ compiler setting in CCS v6.1

Hello,

         I am working with C++ library of wavelet and It is giving lots of error during linking process. Perhaps I could not enable c++ compiler setting. How can I enable the c++ compiler setting? 

I am getting following error

'Invoking: GNU Linker'
"C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-gcc.exe" -march=armv7e-m -mthumb -fno-exceptions -DF_CPU=80000000L -DARDUINO=101 -DENERGIA=13 -Os -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall --entry ResetISR -nostartfiles -nostdlib -Wl,--gc-sections -L"C:/Users/LaxmiKant/workspace_v6_1/lpcc3200_core/Debug" -L"C:/Users/LaxmiKant/workspace_v6_1/lpcc3200_CMSIS_DSP/Debug" -L"C:/Users/LaxmiKant/workspace_v6_1/lpcc3200_UART/Debug" -L"C:/Users/LaxmiKant/workspace_v6_1/lpcc3200_waveletone/Debug" -o"RR_HR_Peak_Rev1.out" "./RR_HR_Peak_Rev1.o"  -Wl,--start-group -Wl,-T"C:/Users/LaxmiKant/Documents/TI/energia-0101E0015/hardware/cc3200/cores/cc3200/cc3200.ld" -l"lpcc3200_waveletone" -l"lpcc3200_UART" -l"lpcc3200_CMSIS_DSP" -l"lpcc3200_core" -l"m" -l"gcc" -l"c" -Wl,--end-group 
./RR_HR_Peak_Rev1.o: In function `__gnu_cxx::new_allocator<double>::allocate(unsigned int, void const*)':
c:\ti\ccsv6\tools\compiler\gcc-arm-none-eabi-4_8-2014q3\arm-none-eabi\include\c++\4.8.4\ext/new_allocator.h:102: undefined reference to `std::__throw_bad_alloc()'
./RR_HR_Peak_Rev1.o: In function `std::vector<double, std::allocator<double> >::_M_check_len(unsigned int, char const*) const':
c:\ti\ccsv6\tools\compiler\gcc-arm-none-eabi-4_8-2014q3\arm-none-eabi\include\c++\4.8.4\bits/stl_vector.h:1339: undefined reference to `std::__throw_length_error(char const*)'
./RR_HR_Peak_Rev1.o: In function `std::vector<std::complex<double>, std::allocator<std::complex<double> > >::_M_check_len(unsigned int, char const*) const':
c:\ti\ccsv6\tools\compiler\gcc-arm-none-eabi-4_8-2014q3\arm-none-eabi\include\c++\4.8.4\bits/stl_vector.h:1339: undefined reference to `std::__throw_length_error(char const*)'
./RR_HR_Peak_Rev1.o: In function `__gnu_cxx::new_allocator<std::complex<double> >::allocate(unsigned int, void const*)':
c:\ti\ccsv6\tools\compiler\gcc-arm-none-eabi-4_8-2014q3\arm-none-eabi\include\c++\4.8.4\ext/new_allocator.h:102: undefined reference to `std::__throw_bad_alloc()'
c:\ti\ccsv6\tools\compiler\gcc-arm-none-eabi-4_8-2014q3\arm-none-eabi\include\c++\4.8.4\ext/new_allocator.h:102: undefined reference to `std::__throw_bad_alloc()'
collect2.exe: error: ld returned 1 exit status
gmake: *** [RR_HR_Peak_Rev1.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

  • I am unable to reproduce these diagnostics, so I am not certain what is going on.

    To build C++ code, you need to change arm-none-eabi-gcc.exe to arm-none-eabi-g++.exe .  I also find your use of the option -fno-exceptions to be suspicious.  Though I cannot prove that is the root cause of your problem.

    Thanks and regards,

    -George

  • Hello George,
    did you compiled wavelet library sucessfully without any error? and How can I enable g++ compiler, I am getting any option to set it in CCS v6.1.
  • LAXMI KANT TIWARI said:
    did you compiled wavelet library sucessfully without any error?

    No.  I am not familiar with that library.

    LAXMI KANT TIWARI said:
    How can I enable g++ compiler, I am getting any option to set it in CCS v6.1.

    I didn't realize you were building in CCS.  I thought you were building from the command line.  From within CCS, there is no method for choosing between gcc and g++.  For compiling, it doesn't matter.  gcc and g++ decide how to compile based on the file extension.  file.c is a C source file, and file.cpp is a C++ source file, and so on.  For linking, you can control it by which libraries you choose.  In your case, add the library specification -lstdc++ to the link.  Even though gcc is used to link, adding this library makes it work.  The details on adding a library to a ARM GNU link in CCS are in this post.  Note you add the library name "stdc++".

    Thanks and regards,

    -George