usr/bin/ld: cannot find -l

前端 未结 14 2957
离开以前
离开以前 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 07:49

    Apart from the answers already given, it may also be the case that the *.so file exists but is not named properly. Or it may be the case that *.so file exists but it is owned by another user / root.

    Issue 1: Improper name

    If you are linking the file as -l then library file name MUST be of the form lib If you only have .so file, rename it!

    Issue 2: Wrong owner

    To verify that this is not the problem - do

    ls -l /path/to/.so/file
    

    If the file is owned by root or another user, you need to do

    sudo chown yourUserName:yourUserName /path/to/.so/file
    

提交回复
热议问题