I'm using linux and I have downloaded a tarball of the soem1.3.0 library that I want to use. I have compiled the library and now I would like to use it. Problem is, I don't know how to do this.
I have a folder called "Project" and in this folder I have a subfolder containing the compiled library (this subfolder contains more folders containing .a files and header and source files) called "Project/SOEM1.3.0". The project folder also has my main function source file, "Project/main.cpp". When I try to compile this main.cpp, the compiler (g++) says that the header files I'm trying to include are unknown.
I guess I have to tell the compiler where to find the library, but how do I do this? I tried copying the entire SOEM1.3.0 folder to /usr/lib, assuming my compiler would be able to find it but this didn't work. Can anybody tell me what to do?
Update: I have been able to include the headers by using "-I path/to/headers". But now the compiler/linker is complaining it cannot find the functions described in the header files. I tried using "-L path/to/libsoem.a -l soem -I path/to/headers" but without result. Any suggestions? Just to be clear, the libraries are called libsoem.a, libosal.a and liboshw.a, and the command i'm trying:
gcc -L SOEM1.3.0/lib/linux -l soem -l osal -l oshw -I SOEM1.3.0/soem -I SOEM1.3.0/osal
-I SOEM1.3.0/oshw/linux -o test main.cpp
configure
which generates the correct make environment. Then run make. – suspectus