views:

36

answers:

2

I noticed this command:

gcc -Wall `libnet-config --defines` libnet-example-x.c -o libnet-example-x `libnet-config --libs`

What is the meaning of libnet-config --defines and libnet-config --libs?

+3  A: 

It is executing a program that generates the necessary gcc arguments to compile an application that uses libnet.

Execute this at the command line and you will see what is going on:

 libnet-config --defines
mikerobi
I see , thank you. but it give me some undeclared errors when i make the example, for example:LN_ERR_WARNING. i think i miss something :(
why
as you say, "libnet-config --libs" generates '-lnet'
why
@sharp, If you are having compilation problems I suggest you open another question. Getting something compile might have been your goal, but is outside the scope of the question you asked.
mikerobi
+2  A: 

libnet-config is an executable that will return a list of -D... options for gcc when called with the argument --defines and a list of -l... with the other argument.

Benoit