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.

PROCESSOR-SDK-AM57X: Code Composer Studio 11 doesn't see std library : #1965 cannot open source file "iostream"

Part Number: PROCESSOR-SDK-AM57X

I recently started working at a new company and inherited an old codebase.  The current codebase is written primarily in C with some C++ classes thrown in here and there, but the C++ classes only use C libraries.

The company wants us to update the code, but to ensure we don't negatively impact performance I wanted to benchmark the existing code.  I created a simple logging class, but the code doesn't compile with the error : #1965 cannot open source file "iostream".

Please note: I have never worked with Eclipse or Code Composer Studio.  I also come from a software engineering background, so my electronics experience is limited.

My first thought was to get the latest version of libcxx, but that didn't work.  I then found a post by George Mock (here) that advised against importing libcxx directly.

I tried Updating Providers: Selected CDT Cross GCC Built-in Compiler Settings from Properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers, and update the Command to get compiler specs to : g++ -std=c++14 -E -P -v -dD "$({INPUTS}" (based on suggestion from another forum post), but that also didn't resolve the issue.

I've included an image of the first set of compile-time errors.  The resource called Logger is the class I created.  If I exclude that class (which uses <iostream> and <unistd.h>) from the build, it compiles without errors.

NOTE: This code base has been in continuous production since 2004 and is very messy.  No coding standards were followed and there are no tests.  All these things will be implemented once I can get the code to see the C++ std libraries and compile.

I would very much appreciate if someone could give me some guidance in getting this working.

My environment is as follows.

Ubuntu 20.04

Code Composer Studio 11.2.0.00007

XDC Tools 3.55.02.22 core

Processor SDK : RTOS AM57xx 06.03.02.08

  • Please rebuild one source file in the project that gets the error diagnostic about iostream.  Right click on the name of the file and choose Build Selected File(s).  Then save the contents of the Console (not Problems) view to a text file.  Use the icon named Copy Build Log.  When you name the log file, be sure to use the file extension .txt.  Please attach that text file to your next post.

    Thanks and regards,

    -George

  • Hi George, Thank you for the response.  I've attached the file as requested.

    6622.BuildLog.txt
    **** Build of configuration Debug for project DspAm750 ****
    
    /opt/ti/ccs1120/ccs/utils/bin/gmake -k -j 12 Messenger.obj -O 
     
    Building file: "../Messenger.cpp"
    Invoking: C6000 Compiler
    "/opt/ti/ccs1120/ccs/tools/compiler/ti-cgt-c6000_8.3.12/bin/cl6x" -mv6600 --include_path="/opt/ti/ccs1120/ccs/tools/compiler/ti-cgt-c6000_8.3.12/include" --include_path="/srv/TI_AM57x/dsplib_c66x_3_4_0_4/packages" --include_path="/home/bkleynhans/svn/critical_link/trunk/ARM_DSP_AM57/DSP" --include_path="/home/bkleynhans/svn/critical_link/trunk/ARM_DSP_AM57/DSP/common" --include_path="/home/bkleynhans/svn/critical_link/trunk/ARM_DSP_AM57/DSP/commonapi" --include_path="/home/bkleynhans/svn/critical_link/trunk/ARM_DSP_AM57/DSP/sigproc" --include_path="/home/bkleynhans/svn/critical_link/trunk/ARM_DSP_AM57/DSP/fft/" --include_path="/home/bkleynhans/svn/critical_link/trunk/ARM_DSP_AM57/DSP/fft/ti/fftlib/src/common" --include_path="/home/bkleynhans/svn/critical_link/trunk/ARM_DSP_AM57/DSP/fft/ti/fftlib/src/common/fft" --include_path="/home/bkleynhans/svn/critical_link/trunk/ARM_DSP_AM57/DSP/fft/ti/fftlib/src/common/ifft" --include_path="/opt/ti/ccs1120/ccs/utils/bin" --define=am5728 --define=core1 --define=C66X --define=SOC_AM572x --define=evmAM572x --define=ti_targets_arm_elf_M4 --define=BUILD_DEBUG --define=BUILD_FIZno --define=BUILD_871no --define=BUILD_MODEL_Ano --define=BUILD_750 --define=BUILD_731 --define=TIFFTLIB --define=DSP1 -g --c++14 --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="Messenger.d_raw" --exceptions --cmd_file="configPkg/compiler.opt"  "../Messenger.cpp"
     
    >> Compilation failure
    subdir_rules.mk:7: recipe for target 'Messenger.obj' failed
    "/home/bkleynhans/svn/critical_link/trunk/ARM_DSP_AM57/DSP/common/Logger.h", line 13: fatal error #1965: cannot open source file "unistd.h"
    1 catastrophic error detected in the compilation of "../Messenger.cpp".
    Compilation terminated.
    gmake: *** [Messenger.obj] Error 1
    
    **** Build Finished ****
    

    Kind regards,

    Ben

  • Thank you.

    The header file unistd.h is not standard.  None of the compilers from TI, including the C6000 compiler, supply it.  It is likely that none of the functions declared in it are supported.

    The header file iostream is supported.  Based on what I have seen so far, I would expect you to have no problem with it.  Do you still have problems with iostream?

    Thanks and regards,

    -George

  • Hi George,

    Thank you for the information.  This indeed was the problem as when I included unistd.h directly the error was resolved.