Mac OS で libnet を使用して C でプログラミングしたいと考えています。
と入力するとgcc *.o -o network -lnet
、エラーが発生します。
-lnet のライブラリが見つかりません。
homebrew
install linnetを使用すると、次のように表示されます。
警告: libnet-1.1.6 は既にインストールされています。
Mac OS で libnet を使用して C でプログラミングしたいと考えています。
と入力するとgcc *.o -o network -lnet
、エラーが発生します。
-lnet のライブラリが見つかりません。
homebrew
install linnetを使用すると、次のように表示されます。
警告: libnet-1.1.6 は既にインストールされています。
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.