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

Segger Embedded Studio - fails to read imported relative file paths

(note - my core problem is that I'm trying to compile a file that's larger than 32KB, so I can't use uVision - if there is an easier way to circumvent this then I don't really care about getting Embedded Studio to work.)

So I've followed this tutorial (link) for importing a uVision project into Segger Embedded Studio. I'm using an MPU example library (link) and would like to compile an example that's >32KB, so to test out SES I'm first trying to import a file that both SES and uVision can compile to make sure the file works in the first place on uVision. I've confirmed the project builds and runs out of the box on uVision, but when importing the project in SES, all of my #include statements throw an error: "nrf.h: No such file or directory." When importing, I made sure to select "use Embedded Studio's Internal Toolchain (GCC/Clang)," but when I check "Project -> Edit Options -> Preprocessor -> User Include Directories" I don't see any directories by default.

To fix this, I copy over all of the relative file-paths from uVision's "Options for Target -> C/C++ -> Include Paths", but even after copying these relative paths the files are not found. The only remedy I've found so far is searching for each include file, finding the directory it's contained in, and hardcoding that file's absolute path in the "User Include Directories" field.

Any advice on how to get paths to #include files to work?

Thanks in advance!

Parents
  • well there's three ways to do it depending on how your project is set up. If you are using a project which is located inside the SDK (like all the SDK examples are) you need to add paths relative to the root of the project, ie they'll all start ../../../ some number of times. But yes you need to work through and add them all. (I always wished the includes were full path includes and not just single named files). 

    If your project is somewhere entirely different then you have to either do what you're doing, add the full absolute path, or set up a macro variable in SES (I have one called NRF_SDK_ROOT) and add ${NRF_SDK_ROOT}/path/to/file.h. That's kind of handy because when you change SDKs, often you just need to change the macro variable. 

Reply
  • well there's three ways to do it depending on how your project is set up. If you are using a project which is located inside the SDK (like all the SDK examples are) you need to add paths relative to the root of the project, ie they'll all start ../../../ some number of times. But yes you need to work through and add them all. (I always wished the includes were full path includes and not just single named files). 

    If your project is somewhere entirely different then you have to either do what you're doing, add the full absolute path, or set up a macro variable in SES (I have one called NRF_SDK_ROOT) and add ${NRF_SDK_ROOT}/path/to/file.h. That's kind of handy because when you change SDKs, often you just need to change the macro variable. 

Children
No Data
Related