This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Adding a new header file Segger Embedded Studio

I realize I am like the hundredth person to have this problem but all the solutions I have found don't seem to work.

I am trying to add a simple header file to the nordic ble_blinky example but keep getting a `No such file or directory`.

The files I am trying to add are led_service.h and button_service.h along with there respective .c files.

The Error:

The solutions I have found:

1. Adding the Project include directory: 

I can't seem to find the actual location. The Segger Embedded Studio Manual after a file search says "The absolute value of the Project Directory project property of the current proje ct. [sic] If this isn't set then the directory containing the solution file. [sic]" (p. 1016) Which to be frank doesn't make sense to me. It seems unfinished. But at any rate, I added it.

2. Watched these videos: 

     SEGGER Embedded studio – Getting started

3. Looked at the manual on how to add a new file:

    "To add a new file to a project:
     1. In the Project Explorer, right-click the project to which you wish to add a new file.
     2. Choose Add New File." (p. 66)

...My current emotion

Please help.

Thank you.

Parents
  • I see that within your project you created a folder called ble_cus. These folders are just section labels within the SES XML based project file. They do not relate to the operating system file system.

    Did you create an actual file system directory called ble_cus and place your new files into it?

    If you created the new files within SES then unless you changed the location for the file within the pop-up dialog the new files will be created within the project directory.

  • So I created the folder within my system directory however that seems to make thing worse. 

    When I try to click on the files they cannot be read.

    It looks like it can find the files when I keep them where they were. It just can't compile them in with the project. It has to be some sort of simple linking error I am having.

Reply Children
  • Hi, 

    Did you move the files over to your new directory? If you did then you will need to remove them within SES Project explorer and then add them back in as "Add existing file"

    If you're not sure where they actually are then right click on the file in question within SES project explorer and select "Select in File Explorer" in the pop-up menu this should help you locate them.

    As long as you have an include path to where they reside then you should be okay.

  • That seems to be a tedious way of creating and managing files, but it worked.

    Time to solve the next problem that crops up.

    Thanks, my good sir. 

    Cheers 

  • No problem.

    Just remember:

    • The folders within SES Project Explorer are just for organising your project view. The files shown can be in different directories to each other and ones not matching the folder name.
    • Whenever you add a new file ensure that you specify its location in the creation dialog box.

    I tend to place my own code in a Directory called "Application_Files" within my project, although in SES project explorer they may show up as in "Application_Files\BLE_Services" or "Application_Files\Protocols". I then use an include path of "$(ProjectDir)/Application_Files" and it will pick them all up.

    The compiler uses the project description file to locate the C code, but the header files are located from your pre-processor include path names.

  • Thanks for contributing with a solution cbd.

    I'm glad you were able to figure it out.

    Cheers.

Related