3

I've created a simple project to learn how to create a static library. I've created a new workspace in CodeLite and a new project and a new static library.

In the static library I've got, inside a "include" folder a .h file called helloworld.h and inside a "src" folder a .c file called helloworld.c. The output files are generated in a folder inside the workspace in a folder called lib (../lib).

Inside the same workspace I have a project with a file .c where the helloworld is called with #include "helloworld.h". Finally, the settings of the project are:

linker menu:

linker menu Libraries search path: ../lib Libraries:

HelloWorldLib

General Menu:

general menu

When I compile the project I got the following error:

      fatal error: 'helloworld.h' file not found

The only way that the project compiles without problems is to get the relative path to the file within the include parameter:

       #include "../HelloWorldLib/include/helloworld.h"

I wonder if there is a way to work without having to add the path to the file. I'm using CodeLite in MAC OS 10.9.5. The same problem occurs in Ubuntu.

My teacher explained that this does not occur in CodeLite Windows, but he doesn't know what could be happening in Mac. Moreover, it should not be necessary to use the path within the include parameter.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
user2233540
  • 427
  • 2
  • 5
  • 10

1 Answers1

0

If you go to the "Compiler" tab instead of the "Linker" tab, try adding your 'include' directory under the "Include Paths" option.

Richard Williams
  • 291
  • 2
  • 11