0

Mac OS で libnet を使用して C でプログラミングしたいと考えています。

と入力するとgcc *.o -o network -lnet、エラーが発生します。

-lnet のライブラリが見つかりません。

homebrewinstall linnetを使用すると、次のように表示されます。

警告: libnet-1.1.6 は既にインストールされています。

4

1 に答える 1

0

It is the problem of library PATH.Flow the steps to solve this problem. First, find where you install the library. For my case, the libnet is located in /usr/local/Cellar/libnet/1.1.6. Second, run /usr/local/Cellar/libnet/1.1.6/bin/libnet-config. Third, use -L to add the path when you link. gcc *.o -L/usr/local/Cellar/libnet/1.1.6/lib -lnet.

于 2015-07-15T01:49:54.480 に答える