Hi, I'm new to static libraries and am trying to use a static library in my code.
First, I created a static library, libfunc.a, using this code:
g++ -c math.cc
ar rcs libfunc.a math.o
I have another file, main.cc, that needs to use a function, eval() in the math object.
I tried to include the libfunc library:
in the main.cc file, but that generates an error (in every line of the libfunc.a file).
I know I have to link main.cc with the library using:
gcc main.o -lfunc -o main
but I can't call the methods in math from the main file.