usr/bin/ld: cannot find -l

前端 未结 14 2959
离开以前
离开以前 2020-11-22 07:07

I\'m trying to compile my program and it returns this error :

usr/bin/ld: cannot find -l

in my makefile I use the c

14条回答
  •  甜味超标
    2020-11-22 08:01

    During compilation with g++ via make define LIBRARY_PATH if it may not be appropriate to change the Makefile with the -Loption. I had put my extra library in /opt/lib so I did:

    $ export LIBRARY_PATH=/opt/lib/
    

    and then ran make for successful compilation and linking.

    To run the program with a shared library define:

    $ export LD_LIBRARY_PATH=/opt/lib/
    

    before executing the program.

提交回复
热议问题