Issue with simple Makefile: undefined reference to symbol 'cos@@GLIBC_2.2.5'

后端 未结 2 599
南旧
南旧 2021-02-18 13:44

I\'m trying to compìle some test C code using a Makefile. The main.c file includes two headers:

#include \"circle_buffer.h\"
#include \"window.h\"
<         


        
相关标签:
2条回答
  • 2021-02-18 14:32

    Sounds like the math library, libm needs to be linked in. Add -lm to the linking stage.

     LIBS=-L/usr/lib/x86_64-linux-gnu -lsndfile -lm
    
    0 讨论(0)
  • 2021-02-18 14:35

    Also try to use c++ instead of gcc compiler. It includes this library by default.

    0 讨论(0)
提交回复
热议问题