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.

Setting up CCSV5 for Hello World c/c++ projects



Hello, I am new to c/c++ programming and am trying to run the c/C++ hello world projects. I get the "Symbol "... " could not be resolved... Semantic Error". My research points to my project not having the correct files in it but I don't know which files to include to get the project to compile and run properly. Please help me get this going! Thanks!

  • Hi Matthew,

    have a look at this useful wiki and keep us informed whether it helps.  It should   Getting unresolved symbols is usually from the linker not being able to find an include path.

    http://processors.wiki.ti.com/index.php/Include_paths_and_options

    Best Regards,
    Lisa

  •  That's what I meant by my research told me it's probably the included file and I don't know which ones to include! I also assumed that saying the example problems told everyone that I was using the basic hello world examples for both c and c++ too. But I guess since you posted that link I need to clarify too; so here's the code for both examples. I have a general idea that I would need the header files that had the #include definitions in them correct? But I'm not sure where I would find them in the compiler folders or where to place them into the project so the compiler would find them. I read how to link the files but I don't know which ones to find. Sorry for assuming so much but I figured since this was a common occurrance someone would be able to point me in the right direction with the information I gave earlier! I am sure now there will be no more questions about it. Thanks!

    #include <iostream>

    using namespace std;

    int main()

    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!

    return 0; }

     

     

    The error codes are:

     Symbol 'cout' could not be resolved    Semantic Error

    Symbol 'endl' could not be resolved     Semantic Error

    Symbol 'std' could not be resolved       Semantic Error

     

    and

     

    #include <stdio.h>

     #include <stdlib.h>

    int main(void) {

      puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */

      return EXIT_SUCCESS; }

     

    The error code is:

     Symbol 'EXIT_SUCCESS' could not be resolved     Semantic Error

     

     

    Which files do I include into the linker and where do I put them into my project for these projects to compile and run?

  • Can someone please help me with this?!

  • Hi Matthew,

    we had forum issues which means I just now saw that you had responded.  Let me have a quick look at get back to you shortly.

    Best Regards,

    Lisa

  • Hi,

    matthew mangani said:

    Which files do I include into the linker and where do I put them into my project for these projects to compile and run?

     
    Please check the attached project that uses C++ code and see if it works for you. It was created with CCSv5.1.1.00031.
     
    Hope this helps,
    Rafael
    Restrict_testcase.zip
  • Hi Matthew,

    what target are you using?  Do you create a CCS project?  If you create a CCS project there are some examples in the create project wizard which will have the necessary header files referenced. 

    One silly thing I see that might be the issue ... you have <iostream> ... should it not be <iostream.h>

    Items like stdio and iostream should not need a special path added.

    Please keep us informed.

    Best Regards,
    Lisa

  • Hello Rafael,

    I imported the project into CCS (Version: 5.1.1.00031) and build it. There were many errors and cautions. 5554.testCase.log I inserted the log file. Hopefully this will point us in the right direction.

    -Matt

    I uninstalled everything and reinstalled ccs. I tried to import the project as a ccs project instead of a C++ project as before... I got this error: See details below.   Error: Import failed for project 'Restrict_testcase' because its compiler definition is not available. Please contact support.

    Please tell me how to fix this. Thank you.

     

  • Lisa,

    I initially wrote I was using the hello world projects. I only used them to test out CCS.

  • Mattew,

    The project was created for the C6000 devices, but it seems you don't have this family installed in your system. Can you tell which device you are using so I can adapt the testcase?

    Cheers,

    Rafael

  • No family was intended. I just wanted to run a c/c++ program to get refamiliar with it.

  • Hi Matthew,

    just thought I would check whether there is an update to your enquiry here.

    Best Regards,
    Lisa

  • Hi Matthew,

    in CCS you need to assign a target to a project.  If you do not have C6000 support installed you will get an error.  What do you see under Window->Preferences->COde Composer Studio->Build->Code Generation Tools?

    Best Regards,
    Lisa

  • Hi Matthew,

    just wanted to check whether there was an update and whether you could provide the requested information.

    Best Regards,
    Lisa

  • You might check what the "extension" (a.k.a. "file type") is on the source file.  It seems that your C++ file was compiled in C mode.  Usually C++ source files have an extension like .C (upper-case) or .cpp.

    As to EXIT_SUCCESS, it is defined by <stdlib.h> on fully standard-conforming "hosted" C platforms, but might not be defined for your particular "freestanding" platform due to the main function's signature not being int main(argc,argv) but rather void main(void), as is often the case for embedded systems.  (There is no "operating system" to report termination status to.)

    Try experimenting with these, or just copy an example project (which is often supplied when you purchase a development board).  Good luck!

  • matthew mangani said:

    The error codes are:

     Symbol 'cout' could not be resolved    Semantic Error

    Symbol 'endl' could not be resolved     Semantic Error

    Symbol 'std' could not be resolved       Semantic Error

    These error messges come from Eclipse, not from the compiler. Googling these errors yields several forums with people asking the same question, but no answer I find definitive.

    The log file you attached has a long list of heinous Java exceptions , which again come from Eclipse, not the compiler.  I cannot make sense of them, someone from the TI Eclipse team will need to look at them.

    Are there any other errors?  Does an executable file get generated?

  • Sorry I'll have to relook over it again. I was hoping to do that today but I won't be able to get to it till next week.