Wednesday, June 28th 2017, 12:22pm UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

HolyDiver

Beginner

Date of registration: Sep 1st 2016

Posts: 5

1

Wednesday, January 25th 2017, 4:56pm

"Project items" for dummies question

I always find myself disliking IDEs project management, mainly because it's not transparent I think.

I'm playing with the simple Hello World example in emStudio, and I am trying to add a linkable library (CException).

1. I add a dynamic folder called CException, and point to where I have cloned CException.
2. I exclude test in the dynamic folder configuration, because I have no interest of that
3. I click on the newly added CException, and select Compile (works just fine)
4. In my main.c I try to do #include "CException.h" but compile fails because "CException.h: No such file or directory"

Do I really need to import the content of CException into my project in order for this to work??

In short, I understand _nothing_ about how emStudio handles build dependencies and how to properly add libraries to a project and I can't find any documentation either that clearly explain how to do this...

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 350

2

Tuesday, January 31st 2017, 5:55pm

Hi,

Embedded Studio does not take the include directories from the project folders.

Instead, as with most toolchains, you need to specify them in the project options.
To do this, in the project options go to C/C++ -> Preprocessor and add CException, or the directory CException.h is located in, to the User Include Directories.

Adding CException.h to your Embedded Studio project will do nothing but showing it there.

To add a library, you can either have a solution with your application project and the library project and make the application dependent on the library, this way it will link the output of the library project,
or you add the library file in the project options at Linker -> Additional Input Files if it is no dependency of the application project.

In general Embedded Studio doesn't do any magic. If you want it to use a file, you need to add it to the appropriate options.

Regards
Johannes