Maximetinu
Maximetinu

Reputation: 159

Impossible to install shared library with .so file

I'm not able to install this library on Ubuntu, or at least to compile a .cpp linking the library to it. I have finish all Google and StackOverflow answers.

So ok, first of all I run cmake and after I run make (and make install to be sure). Still, if I run g++ xxx.cpp -lcrb -o test I get this error: fatal error: CRNB.h: No such file or directory. The library doesn't like to be installed yet, so I copy the libcrn.so file to /usr/lib and I run sudo ldconfig to load it. Now...

Anyways, trying to compile still throws the same error. I have also tried...

And many more similar. As you can see all this things are the same, so it's clear that I'm losing something important. Anyone knows what it could be?

Thanks a lot!

Upvotes: 0

Views: 1859

Answers (1)

Lifka
Lifka

Reputation: 249

You need to specify with "-I" flag the include directories, or import it to your system.

Try:

g++ src_name.cpp -L./your/library -lcrn -I./your/headers -o out_name -std=c++11

Or:

You can copy from libcrn include files ("*.h") to "/usr/local/include/" and the library to "/usr/local/lib/" if doesn't exist, and then:

g++ src_name.cpp -lcrn -o out_name -std=c++11

Upvotes: 1

Related Questions