Originally posted by creznedmick
[...]compile a library file [...]
the compile line I used is :
g++ myMath.cpp -Wall -o myMath
You are trying to link
the object file as well with this command line. As there's no main() function because it's a library, this will fail.
gcc -Wall -c -o myMath.o myMath.c
After that, you can convert it to a static library with:
ar crv libmyMath.a myMath.o
After this you can use it with gcc's "-l myMath" (and "-L /directory/of/your/libmyMath)" option to use it in programs.
(for dynamic libs I don't know...)