usr/bin/ld: cannot find -l

前端 未结 14 2726
离开以前
离开以前 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:55

    I encountered the same error message.

    I built the cmocka as a so and tried to link it to my executable. But ld always complains below:

    /usr/bin/ld: cannot find -lcmocka

    It turns out that there are 3 files generated after cmocka is built:

    1. libcmocka.so
    2. libcmocka.so.0
    3. libcmocka.so.0.7.0

    1 and 2 are symbol links and only 3 is the real file.

    I only copied the 1 to my library folder, where ld failed to find the 3.

    After I copied all 3, ld works.

提交回复
热议问题