Page 1 of 1

How to add lib files

Posted: Sun May 26, 2024 6:24 am
by Linkpad
Hi,

I am trying to understand the PlatformIO settings for projects and working on a new project which has external library files (headers & source files) which I have put in the 'lib' directory assuming the main.c file would automatically be able to find the path of these files as long as my include lines where correct. But from several attempts at doing this the program fails to compile and refuses to find the library files? I have included a screenshot am I doing something wrong?
Capture202.PNG
Capture202.PNG (95.43 KiB) Viewed 631 times

Re: How to add lib files

Posted: Tue May 28, 2024 11:07 am
by stevenbennett
I assume you have run BUILD and restarted VSCode? The red squiggles often disappear then. Also tft.h and tftspi.h are in the folder tft so perhaps you don't need to specify the folder, could you try just #include "tft.h" and #include "tftspi.h".

Re: How to add lib files

Posted: Sat Jun 01, 2024 4:34 pm
by Linkpad
Hi, I managed to get it too work by using #include <included.h> format which auto lists all the header files.

Re: How to add lib files

Posted: Sat Jun 01, 2024 5:34 pm
by stevenbennett
Good that you got it working. Was the solution to surround the header file names with < > instead of " " ?