I have a directory named FOO which has X.a and X.so . I want to choose only X.a.
So in my makefile I am using the following to link it
EXE: OBJ.o
g++ -L/PATH/TO/FOO -o $@ $< -static -lX
But when I do that, I get the following error
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
How should this be done properly. One way is to give abs path of X.a. Is there some other way?
Try this: