call C libraries from within nested folder

Jan 31, 2012 at 11:31am
Hi experts

I have a little issue with the gcc compiler suppose you have two files library.c and library.h and you want to use them within your main.c file
You do
#include "library.h" and you start make use of the library in your code and you will not encouter a problem and the code is executed normally if the main.c,library.h and library.c are in the same folder, however if you place library.c and library.h in a separate folder say a nested one and you try to use the library using "foldername/library.h" then all methods within that library will not be recognized at the main.c. The question is how to use c libraries that are in different folders than the executing code one the main.c in this case

Thank you
Jan 31, 2012 at 2:03pm
You still have to compile library.c
Feb 1, 2012 at 10:22am
Hi LB
Thank you for the response. The C library is compiled but it is located in a different project in a different folder other than the executing program that's the issue. when all the staff is in the same folder it executes normally but in a separate folder the compiler tells me that it doesn' t recognise the all the staff within the c library

Thank you
Feb 1, 2012 at 1:04pm
You should tell it to compile it. You can compile files as the same project even if the sources are in different folders ;)
Topic archived. No new replies allowed.