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

Help when importing library (and it's dependencies) to an existing project

Hello!  I'm somewhat new to SES and still trying to understand the program a bit.  Some of the features are a bit less intuitive than others. 

Right now, I'm actually not having many problems with the code itself as much as I am with how to add libraries to my project.  For instance, I started a project from an example and I've added additional functionality to the project.  I have it working with a few different sensors using TWI/I2C. 

I am now adding ADC to my project.  To get this working, I ran into several instances of statements that don't exist.  I ended up going into the config file and adding a lot of code from the other project, which seems to have helped most my issues. 

The issue I am currently having is that I can't seem to find a way to import a library with all its dependencies.  For instance, below is an example of a currently working project:

As you can see, each of the modules (specifically the nrf_pwr_mgmt.c library) is already in the other project, complete with all it's dependencies. 

I'm now right clicking and adding an existing file, selecting the *.c and *.h files and it will import those files in, but none of their dependencies:

Now when I try to compile the project, I'll get an error about a missing file that I need to be included in order to get the project to compile:

What's the easiest way to transfer an entire library and it's dependencies?

Please let me know when you get the chance.  Thanks!

  • Hi Jay, 

    What's the easiest way to transfer an entire library and it's dependencies?

    We usually suggest to duplicate and develop from the example project. Also, see the Adding files documentation. 

    -Amanda H.

     

  • That's what I did.  I started with an example project but that didn't have everything I needed in it, so I needed to take files from other example projects, which means I need to add them to this project. 

    That link gave me info on how to add files (which I demonstrated above that I've actually already done).  What I need to know is how do I add the library files and all their dependencies?  That power management library has 60 dependencies and should generate a *.o file in the output folder.  The other example projects have it already setup to provide this.  Is there not a documented way to add a library to a project?  I assumed I could right click on the library folder and "add library" but there doesn't seem to be that option. 

  • I think I found a solution.  Turns out I need to open the *.emProject and add the paths to the c_user_include_directories, and then make sure they're added to the library section.  That seemed to work for me. 

    Hopefully, this will help someone else as well!

Related