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.

Can't open source file xdc/std.h

Hi,

I am following the tutorial link below on CCSv4.0.1.

http://rtsc.eclipse.org/docs-tip/Demo_of_RTSC_Project_Creation_in_CCSv4

It seems the interface somehow changed a bit compared to the tutorial. For example, in RTSC Configuration Settings section: I see a Dais section and there is no whole_program_debug option. But it did generate two projects: hellobios6 and hellobios6_configuration. When I tried to build it, I got an error:

could not open source file "xdc/std.h"

The Include section under hellobios6 doesn't have <CCS_directory>/xdctools_3_15_02_62/packages included but it shows under hellobios6_configuration. Even when I manually added xdctools_3_15_02_62/packages to hellobios6, it still couldn't pass build.

It should be very simple to let the compiler see the header files.

Thanks.

  • You need to specify a couple -D options when invoking the compiler.  See this article for more info.

  • Thanks. I added the suggested -D options according to the article. I still have the same error. I must have missed something else.

    Here is the console log. Still is a problem where to specify xdc/std.h, it is not in -I option.

    **** Build of configuration Debug for project hellobios6 ****

     

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all

    'Building file: ../hello.c'

    'Invoking: C6000 Compiler'

    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/bin/cl6x" -mv64+ -g --fp_mode=strict --define=xdc_target_types__=ti/targets/std.h --define=xdc_target_name__=C64P --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include" --diag_warning=225 --sat_reassoc=off --fp_reassoc=on --mem_model:const=data --mem_model:data=far_aggregates --preproc_with_compile --preproc_dependency="hello.pp" "../hello.c"

    "../hello.c", line 16: fatal error: could not open source file "xdc/std.h"

    1 fatal error detected in the compilation of "../hello.c".

    Compilation terminated.

     

    >> Compilation failure

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: *** [hello.obj] Error 1

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: Target `all' not remade because of errors.

    Build complete for project hellobios6

  • I think it's resolved: still need to add -I in addition to the -D optons.

    Thanks

  • Steven,

    You are not required to add -I or -D options to your project. The application project should simply get the package path from the configuration project.

    Background : The RTSC configuration project generates a 'compiler.opt'  file that has all the include paths required to consume the RTSC content, and a linker command file - 'linker.cmd' referring the libraries with the RTSC content, memory map for your platform, and placement of sections.  Look at the generated 'configPkg' folder in your RTSC configuration project for these files. The application project refers to the RTSC configuration project and accesses these files for the build. All of this should be transparent to the user. No manual steps are required.

     What version of CCS4 are you using? There were a few bugs related to project references that were fixed in CCS4.1, and you may have hit one one them.

    Can you check whether the application project refers to the RTSC configuration project? Right click on the project in the "C/C++ Project View" then select "Build Properties->CCS Build->Dependencies". You should see the referenced project listed in the table. 

     

    Thanks

    Amit

     

     

  • Amit,

    Thanks for your reply.

    I thought I had fixed it but the more I tried along the path, the more I think there is a bug there. To answer some of your questions:

    1. I am using 4.0.1.01001 version of CCS. Can you verify this version does have a bug on the example on your end?

    2. I checked the Build Properties -> CCS Build Settings -> Dependencies (not Build Properties -> CCS Build), I can see hellobios6_configuration. Reference Build-configuration was originally <Any> and then I changed to <Default>. Not much different in results.

    I got most of your "Background" section. But the linker seems broken. Even I make sure this line is added to the configuration project, common.cfg, according to the XDC Consumer User's Guide manual (the default common.cfg didn't have this line)

    var System = xdc.useModule('xdc.runtime.System');

    The linker still doesn't know where to find System_printf and other System methods.

    Steven

    **** Build of configuration Debug for project hellobios6 ****

     

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all

    'Building file: ../hello.c'

    'Invoking: C6000 Compiler'

    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/bin/cl6x" -mv64+ -g --fp_mode=strict --define=xdc_target_types__=ti/targets/std.h --define=xdc_target_name__=C64P --include_path="C:/Program Files/Texas Instruments/xdctools_3_15_02_62/packages" --include_path="C:/Program Files/Texas Instruments/bios_6_20_01_41/packages" --include_path="C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include" --diag_warning=225 --sat_reassoc=off --fp_reassoc=on --mem_model:const=data --mem_model:data=far_aggregates --preproc_with_compile --preproc_dependency="hello.pp" "../hello.c"

    'Finished building: ../hello.c'

    ' '

    'Building target: hellobios6.out'

    'Invoking: C6000 Linker'

    "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/bin/cl6x" -z -m"hellobios6.map" --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/lib" -i"C:/Program Files/Texas Instruments/xdctools_3_15_02_62/packages/xdc/runtime" -i"C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000/include" --reread_libs --rom_model -o "hellobios6.out" "./hello.obj" -l"rts64plus.lib"

    <Linking>

    warning: creating ".stack" section with default size of 0x400; use the -stack

    option to change the default size

     

    undefined first referenced

    symbol in file

    --------- ----------------

    _xdc_runtime_System_printf__E ./hello.obj

     

    error: unresolved symbols remain

    error: errors encountered during linking; "hellobios6.out" not built

     

    >> Compilation failure

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: *** [hellobios6.out] Error 1

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: Target `all' not remade because of errors.

    Build complete for project hellobios6

  • Steven,

    I think there is something wrong with your project. I do not see the 'compiler.opt' file and 'linker.cmd' file being picked up in your application project. Can you create a new project with the wizard and see if you see the same problems? Note that you should not add -D or -I options to the project. 

    Is it an option for you to move to the latest version of CCS- 4.1.2 ? 

    Thanks

    Amit

  • Amit,

    Well, the compiler.opt and linker.cmd problem were the very beginning ones. After playing it around yesterday, I bypassed compiler.opt and linker.cmd errors and came to the point about -D and -I in today's posts.

    To show where I was, I re-created a new project and show you what the errors were (I deleted the old one so I am using the same project name). Here is the console log. I verfiied that the dependencies are correct.

    I think what we have is the 4.0.1 DVD. Is it easy to do an upgrade or need to re-install again? It just took very long to download it.

    Thanks,

    Steven

    **** Build of configuration Default for project hellobios6_configuration ****

     

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all

    'Building target: configPkg/linker.cmd'

    'Invoking: XDCtools'

    "C:/Program Files/Texas Instruments/xdctools_3_15_02_62/xs" --xdcpath="C:/Program Files/Texas Instruments/bios_6_20_01_41/packages";"C:/Program Files/Texas Instruments/ipc_1_00_01_48/packages"; xdc.tools.configuro -o configPkg -t ti.targets.C64P -p ti.platforms.sim64Pxx -r whole_program -c "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/c6000" "../common.cfg"

    making package.mak (because of package.bld) ...

    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...

    configuring common.p64P from package/cfg/common_p64P.cfg ...

    cl64P package/cfg/common_p64P.c ...

    lnk64P common.p64P ...

    /cygdrive/c/PROGRA~1/TEXASI~1/xdctools_3_15_02_62/bin/cp: setting permissions for `linker.cmd': No such file or directory

    gmake.exe: *** [linker.cmd] Error 1

    gmake.exe: *** Deleting file `linker.cmd'

    js: "C:/Program Files/Texas Instruments/xdctools_3_15_02_62/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: *** [configPkg/linker.cmd] Error 1

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: Target `all' not remade because of errors.

    Build complete for project hellobios6_configuration

  • Hi Steven,

    For some reason the 'linker.cmd' is not getting generated in your setup.. Can you send me your projects - both the application and the configuration project - as an attachment?

    Regards

    Amit

    PS - You can upgrade to the latest version of CCS4 by navigating to Help -> Software Updates -> Find and Install

  • Amit,

    What is your email? Alternative to sending you an email with attachment, you can go to this link to reproduce it.

    http://rtsc.eclipse.org/docs-tip/Demo_of_RTSC_Project_Creation_in_CCSv4

     

    P.S.: I did a Software Update and re-ran it, still the same.

    Thanks,

    Steven

  • Oops, I can't upload files because of McAffee's feature here!!

  • Steven,

    You can attach to the forum posts. Go to the "Options" page and select "Add/Update".

    Regards

    Amit

  • I would like to update the forum on the root cause of the problem.

    XDCtools internally uses utilities distributed with cygwin. You can review these utilities in <xdctools_ver>/bin. Problems can happen if there are incompatible versions of cygwin in the system. In this case Steven's system had cygwin version 1.5.18. The utilities shipped with XDCtools 3.15.02 used cygwin version 1.3.12-2. When the RTSC configuration project was built the artifacts - 'compiler.opt' and 'linker.cmd' were not generated. The application project depends on these artifacts, and not finding them it gave a bunch of build errors.  Unfortunately, cygwin version 1.3.12-2 failed silently without giving any indication of the problem. The error messages have improved with later versions of cygwin. The latest XDCtools release - 3.16.03 - ships cygwin version 1.5.25-15. This versions detects the incompatible  cygwin installation problem and throws the following message in the build console:

    219 [main] ? (3440) C:\Program Files\Texas Instruments\xdctools_3_16_03_36\bin\sh.exe: *** fatal error - system shared memory version mismatch detected - 0x75BE0084/0x8A88009C.

    This problem is probably due to using incompatible versions of the cygwin DLL.

    Search for cygwin1.dll using the Windows Start->Find/Search facility

    and delete all but the most recent version.  The most recent version *should*

    reside in x:\cygwin\bin, where 'x' is the drive on which you have

    installed the cygwin distribution.  Rebooting is also suggested if you

    are unable to find another cygwin DLL.

     

    As suggested in the message the problem was resolved by removing the incompatible version of cygwin in the system.

     

    Regards

    Amit 

  • Hi!

    I get to see the same problem, but do not have multiple cygwin dlls on my computer.  Is there some general procedure how to debug what is causing this?

    Thanks!
    Atmapuri

  • Hi,

    This problem is observed because the include paths are not correct in the application project. There are many routes to get here and the cygwin incompatibility mentioned earlier was one of them.What is the build error that you are getting in your application and configuration projects? 

    Also, is it possible for you to attach your projects to this post? We can take a look at the projects to see what going on here.

     

    Regards Amit

  • Dear Amit,

    I use the Wizard to create the Hello World application. I start with "Empty RTSC Project" according to the CCSv4.2. When I try to Build it, the error pops up. I have attached the project. (Had the same problem with CCS4.1) I attached the project. Here is the error message:

     

    **** Build of configuration Debug for project Test ****

    C:\TI\ccsv4\utils\gmake\gmake -k all
    'Building file: ../main.c'
    'Invoking: Compiler'
    "C:/TI/ccsv4/tools/compiler/c6000/bin/cl6x" -mv6740 -g --include_path="C:/TI/ccsv4/tools/compiler/c6000/include" --diag_warning=225 --preproc_with_compile --preproc_dependency="main.pp" --cmd_file="C:/Users/Administrator1/Documents/workspace16/Test_configuration/Default/configPkg/compiler.opt"  "../main.c"
    >> ERROR: Cannot open command file 'C:/Users/Administrator1/Documents/workspace16/Test_configuration/Default/configPkg/compiler.opt': No such file or directory
    At end of source: warning: a translation unit must contain at least one declaration

    5305.workspace16.zip

    I also have one reproducable bug to report. Start a new project and leave it empty. Try to build. Acknowledge the report that there is nothing to build. Now right click on the project and try to add a new file. You will see it is no longer possible. Only two options are left.

    Thanks!
    Atmapuri

  • Hello ,

    Your RTSC configuration project is empty. You need to provide atleast one configuration script (*.cfg) in order for the project to build. I would suggest starting with one of the stock SYS/BIOS templates shown in the wizard that provide application files (*.c) as well as configuration scripts (*.cfg), and then modify it according to your application requirements.

    A bit of background on RTSC configuration...

    A RTSC configuration project encapsulates all the information required to consume RTSC content like SYS/BIOS and IPC. Typically, a RTSC configuration project contains a configuration script (*.cfg). The configuration script is essentially  a javascript file that is used to configure the content that you are trying to consume. For example you can use the configuration script to specify the system stack size of your program, the modules that you need from SYS/BIOS, and statically create tasks. For more details on configuration from a consumer perspective you can refer to this article.

    Now lets analyze the symptoms of the problem that you are seeing. When you build a RTSC configuration project, couple of build artifacts - compiler.opt and linker.cmd - are created in the [Debug|Release]/configPkg  folder of your project. The compiler.opt file provides special compiler flags, include paths and  symbol definitions that are required to compile your application project.  The linker.cmd file provides all the information like the list of libraries, memory sections etc - that is required to link your application. Note that the real benefit to the user is that they do not have to specify all this information manually in their project. In your case since the RTSC configuration was empty the compiler.opt file was not getting generated. When the application project was built it was not getting the right include paths and you saw the could not open source file "xdc/std.h" errors. 

    Let me know if this solves your problem.

     

    Atmapuri said:

    I also have one reproducable bug to report. Start a new project and leave it empty. Try to build. Acknowledge the report that there is nothing to build. Now right click on the project and try to add a new file. You will see it is no longer possible. Only two options are left.

    Can you confirm that you do not see the"Add Files to Project ... option in the menu when you right click on the project?

    Regards

    Amit 

     

  • Dear Amit,

    Thank you for explanation. Somehow I still believe, that a more useful error message could be provided. I followed your advice and added the .cfg file. Now the build is successful, but the linker fails:

    <Linking>

     undefined                     first referenced
      symbol                           in file    
     ---------                     ----------------
     _xdc_runtime_System_printf__E ./main.obj     

     

    How do I fix that? About:

    "Add Files to Project ..."

    Yes, this is still there, but the "New" menu is almost empty for no special reason.

    Thanks!
    Atmapuri

     

  • Atmapuri said:

     

    <Linking>

     undefined                     first referenced
      symbol                           in file    
     ---------                     ----------------
     _xdc_runtime_System_printf__E ./main.obj     

    I think you have an incomplete config script. Right click on the marker in the problems view and then select XDCtools -> Help. This should popup a text box with the script fragment required in your configuration script. You can also look at this FAQ for getting help on build errors from the IDE.

     

    Atmapuri said:

    About:

    "Add Files to Project ..."

    Yes, this is still there, but the "New" menu is almost empty for no special reason.

    Thanks!
    Atmapuri

    Do you see this problem in new workspaces as well? I have seen similar problems when the workspace gets corrupted.

     

    Regards

    Amit

     

     

  • Dear Amit,

    Ok, it is building now : ) I remember I went through the tutorial on this once before and did not try to build a project from scratch yet. It is frustrating though that it is not easier to start with a basic project. Especially the error messaging could be improved.

    >Do you see this problem in new workspaces as well? I have seen similar problems when the workspace gets corrupted.

    Yes. Try to compile the project I sent but remove main.c before that. The new menu items gets emptied, if not at least one c file is present.

    Thanks!
    Atmapuri

  • Atmapuri said:

    Yes. Try to compile the project I sent but remove main.c before that. The new menu items gets emptied, if not at least one c file is present.

    I cannot reproduce this problem. What build of CCS4.2 do you have? 

    Thanks

    Amit

     

  • Atmapuri said:

    Dear Amit,

    Ok, it is building now : ) I remember I went through the tutorial on this once before and did not try to build a project from scratch yet. It is frustrating though that it is not easier to start with a basic project. Especially the error messaging could be improved.

     

    Hello Atmapuri,

    Thanks for your valuable feedback. Our current thinking is to give context specific help information from the problems view. In this case I think it is possible to give an useful message (a concise form of the description given earlier in the post) in a text box similar to what you saw earlier with the linker error. Essentially the user right clicks on the marker and selects XDCtools -> Help and should get some guidance to solve the problem. Do you think this will be helpful in this particular situation?

    Regards

    Amit

  • Dear Amit,

    I think that providing the same kind of behaviour as if when the Target Configuration is missing would be better. You get a message that you are missing configuration and are offered options to point to an existing RTSC cfg file or to create a new one.

    About XDCtools->help. If the help knows what the error is, why it would not suggest the solution? If a type of error is detected for which a solution is known, the IDE could simply suggest to make that for you. Another thing is that  when I pressed OK on the Help window suggesting solution , I was expecting that the changes have already been made.

    UI for XDCtools->help could work like this. You display error message and solution from XDCtools in the same table immediately after compile. That way people dont have to dig through the popup menu and help is displayed immediately next to the error. One button on the toolbar of the error table could be: "fix the problem for me. " Which in some cases is simply to add a var name= ... statement to the cfg file.A window would then popup showing the suggested changes.

    Thanks!
    Atmapuri

     

     

  • Hi Atmapuri,

    You bring up several good points.

    Atmapuri said:

    I think that providing the same kind of behaviour as if when the Target Configuration is missing would be better. You get a message that you are missing configuration and are offered options to point to an existing RTSC cfg file or to create a new one.

    The build system should flag this error upfront. I have filed a bug  against CCS4/5 to track this request - SDSCM00038419

    Atmapuri said:

    About XDCtools->help. If the help knows what the error is, why it would not suggest the solution? If a type of error is detected for which a solution is known, the IDE could simply suggest to make that for you. Another thing is that  when I pressed OK on the Help window suggesting solution , I was expecting that the changes have already been made.

    Good point.  I have filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=329213 to track this issue. BTW - RTSC is an open source eclipse project and if you are using RTSC extensively you can participate in the community news group at http://www.eclipse.org/forums/index.php?t=thread&frm_id=8

     

    Atmapuri said:

    You display error message and solution from XDCtools in the same table immediately after compile. That way people dont have to dig through the popup menu and help is displayed immediately next to the error. One button on the toolbar of the error table could be: "fix the problem for me. " Which in some cases is simply to add a var name= ... statement to the cfg file.A window would then popup showing the suggested changes.

    We are a bit restricted by eclipse here as we have tried to leverage the standard views which are part of the  platform. Unfortunately this UI is a bit limited for our purposes and we have tried to workaround it by providing the pop-up menus. Another more intuitive action that we are exploring would be to hook the double clicking on the marker to bring up the "fix" for the problem.

    I have also added an FAQ in RTSCpedia - http://rtsc.eclipse.org/docs-tip/FAQ-101101-1 - to describe the root cause of this problem.

    Thanks for the  feedback.

    Regards

    Amit