shared object with linked libraries

Hello,

I am trying to create a shared object (.so) and my code depend on linkers (like lapack and blas), so when I do:

g++ -c -fPIC myclass.cc -o myclass.o ~/ap/lapack.h ~ap/blas.h -lblas -lgfortran

it gives me the following:
-llapack: linker input file unused because linking not done
-lblas: linker input file unused because linking not done

and I cannot go ahead with the second step (g++ -shared -Wl....)

How should I do to include the linked libraries so my first step works?

Thanks
Last edited on
Note the compiler option '-c' in your first step, it tells the compiler to only compile your source code and generate object file, no linking here. So compiler warned you that -lblas and -lgfortran are not used as they are for linker.

put -lblas and -lgfortran in your second step will work.
Topic archived. No new replies allowed.