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

How to add paths and symbols manually in Eclipse

I try to use Eclipse for my nrf project. Previously I used Keil but now, I should to use Eclipse. Anyway, I can build nordic sdk example project but when I work with main.c file, I always see unresolved library. I try to add library files manually by right clicking on any of the virtual folders and clicking on import, General->File System and browse the source files in the SDK.

I want to share Eclipse screenshot

Also I read this tutorial but I dont understand 6.step . In this step, he said ;

Debugging will still work without adding the paths and symbols manually as Eclipse is a pure IDE and gcc and gdb take care of the build and debug. However, I prefer to add the paths and symbols in Eclipse to better find declarations,references,etc. located outside main in the project.

But I can not add the paths and symbols.

Do you have any advice?

  • Why don't you use the updated tutorial?

    In this tutorial there's section about autodiscovery of symbols, paths and settings. I believe that should solve your problem.

  • I have already read that tutorial before. I also applied the procedures step by step. Normally I can build project correctly, there is no problem but in main.c the #include library still shows the "unresolved inclusion" error and #define symbols could not be resolved.Screenshot

  • It looks from your last screenshot as the build is successful, is this correct? I.e., it is only "cosmetic" for Eclipse that is complains about the missing symbols and header files? Did you carefully follow the instructions in section "Enable auto discovery of symbols, include paths and compiler settings" in Development with GCC and Eclipse Tutorial?

  • Hi Jørgen, I figure out libraries, but when I buil the project, I got an error like this

    "error: 'err_code' is used uninitialized in this function [-Werror=uninitialized]" Do you have any idea about the problem? Did I add the libraries wrong?

  • Check the references to main.c in your build output. Most likely you are passing err_code to APP_ERROR_CHECK() without initializing it or assigning any value to it.