As a general answer to this question, to make any sdk work, you need to do three things:
#include appropriate headers in your source so that the compiler can verify that you have used the correct functions, and the linker knows which characters you are referring to.- Tell the compiler where your header files are. You can do this with gcc using
gcc -I/path/to/header/dir . - Tell the linker where the lib files should be, which should be compiled and include them. Again, using gcc, you do this with
gcc -L/path/to/library/dir , and you give gcc (well, ld) a link to a specific library with gcc -lnamewithoutlibprefix (lowercase l).
As an example for the library, I use a lot, MPIR, against the / opt tree, I could compile like this:
gcc -I/opt/include -L/opt/lib -lmpir myprog.c -o myprog
This is just an example and very specific to Linux. In truth, MPIR is installed in / usr, and I don't need to do this, I just pick it up as an example here.
For Windows, take a look at cl / I and LINK.EXE Options .
Of course, you can automate this process in different development environments. Visual Studio, for example, will create the correct command lines for you if you fill in the correct dialog boxes. So I believe that Eclipse and I know that Dev / C ++ can also.
user257111
source share