0

プログラムを「作成」しようとしていますが、これらのエラーに直面しています。私は make -lm を使用し、#include も実行しましたが、それでも同じ問題に直面しています。破損したライブラリに関する疑いを確実に取り除くために、UbuntuとDebianの両方にアプリケーションをインストールしようとしましたが、それでも成功しません!

nat_src_endpoint_ip.o: In function `__new':
    /root/softwares/sweetspot-0.0.20/src/nat_src_endpoint_ip.c:95: undefined reference to `ceilf'
    nat_src_endpoint_tcp.o: In function `__create':
    /root/softwares/sweetspot-0.0.20/src/nat_src_endpoint_tcp.c:58: undefined reference to `ceilf'
    nat_src_endpoint_udp.o: In function `__create':
    /root/softwares/sweetspot-0.0.20/src/nat_src_endpoint_udp.c:59: undefined reference to `ceilf'
    nat_src_endpoint_icmp.o: In function `__create':
    /root/softwares/sweetspot-0.0.20/src/nat_src_endpoint_icmp.c:48: undefined reference to `ceilf'
    collect2: ld returned 1 exit status
    make[1]: *** [sweetspot] Error 1
    make[1]: Leaving directory `/root/softwares/sweetspot-0.0.20/src'
    make: *** [all] Error 2
4

1 に答える 1

0

数学ライブラリとリンクする必要があります。Gcc では、これは-lmリンク コマンド ラインに追加する必要があることを意味します (1 つのコマンド ラインのみを使用する場合、このコマンド ラインはコンパイルとリンクの両方に使用されることを意味します)。

于 2013-07-21T17:27:32.550 に答える