usr/bin/ld: cannot find -l

前端 未结 14 2723
离开以前
离开以前 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 07:56

    If your library name is say libxyz.so and it is located on path say:

    /home/user/myDir
    

    then to link it to your program:

    g++ -L/home/user/myDir -lxyz myprog.cpp -o myprog
    

提交回复
热议问题