Question

I'm trying to use a few dynamic library I have written but gcc seems to be unable to find them and I'm not understanding why that is. The files libresistance.so, libcomponent.so and libpower.so are all located in /usr/lib the default location for dynamic libs in Linux as I understand it. So what I'm doing wrong?

C file

#include <resistance.h>
#include <component.h>
#include <power.h>
int main(int argc, char *argv[] )
{
}

Makefile

all:
    gcc `pkg-config --cflags gtk+-2.0` -o elektrotestgtk main.c `pkg-config --libs gtk+-2.0` -L. -lresistance -lpower -lcomponent -Wl,-rpath,
Was it helpful?

Solution

I found the answer, to be able the compile the program gcc need the .h files and for it to find them they need to be placed in /usr/include.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top