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.

Compiling C++ code on C6727 chip

Hi all,

We are using C6727 DSP based board and we are trying to run a c++ based code on to this. But before doing that I just ran a simple C++ code to verify the support for c++. Following is the listing of the code,

#include <iostream.h>

int main()
{
 cout << " hello cpp" << endl;
}

I selected the embedded C++ compiler option in the project build option. When I built the code, I got " unable to open iostream.h" error. I searched for this file in CCS installation. There was only one file in the installation, $(InstallDir)\bin\utilities\sim\gcc\include\c++\3.4.4\backward. But this file again include iostream.

My question is whether I am following right path in compiling code? What else I need to do in order to compile the file? Following are setup details,

i) CCS version 3.3.82

ii) BIOS version 5.31.02

 

Thank you,

    Abhijit

  • It should be #include <iostream> (not iostream.h).

  • Hi adavis,

     Thank you for replaying.

    I tried with #include <iostream> but I am getting error "could not open source file iostream".

    Morever if we want to use this type of inclusion(without .h) extension, we have to use "using namespace std;" which is not supported in embedded C++.

    Regards,

        Abhijit

  • The bad news is that the library has not been built to support iostream for Embedded C++.  There are Embedded C++ equivalents of some header files, including iostream, included in the RTS source file distributed with the compiler, but they are not installed by default and they will not work without an appropriately-configured library.  I recommend you use regular C++ if you need to use iostream.  The overhead of C++ that Embedded C++ tries to avoid can be avoided simply by not using those features of C++ that Embedded C++ excludes.

    Submitted as SDSCM00037867