How to add lib files

Linkpad
Posts: 7
Joined: Sat May 11, 2024 12:35 pm

How to add lib files

Postby Linkpad » Sun May 26, 2024 6:24 am

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 1142 times

User avatar
stevenbennett
Posts: 34
Joined: Sun May 19, 2024 7:30 am
Location: High Bentham, UK

Re: How to add lib files

Postby stevenbennett » Tue May 28, 2024 11:07 am

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".

Linkpad
Posts: 7
Joined: Sat May 11, 2024 12:35 pm

Re: How to add lib files

Postby Linkpad » Sat Jun 01, 2024 4:34 pm

Hi, I managed to get it too work by using #include <included.h> format which auto lists all the header files.

User avatar
stevenbennett
Posts: 34
Joined: Sun May 19, 2024 7:30 am
Location: High Bentham, UK

Re: How to add lib files

Postby stevenbennett » Sat Jun 01, 2024 5:34 pm

Good that you got it working. Was the solution to surround the header file names with < > instead of " " ?

Who is online

Users browsing this forum: No registered users and 231 guests