compilation of header file requested ? what is that mean

Y

yezi

Hi:

I code a main function in one file "nlp.c"
code defination of variabla in one file "nlp.h"

I use "

gcc nlp.c -o nlp.out ; no error message;

I use :

gcc nlp.c nlp.out nlp.h -lm ;

the message is :

compilation of header file requested


WOuld you give me some hint of that , thanks
 
K

Kenneth Brody

yezi wrote:
[...]
gcc nlp.c nlp.out nlp.h -lm ;

the message is :

compilation of header file requested

WOuld you give me some hint of that , thanks

My guess would be that you are telling gcc to compile "nlp.h" and gcc
is saying "why do you want to compile a .h file?"

Though I'm also curious why you are trying to compile a file called
"nlp.out", and why gcc didn't say something about that one as well.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:[email protected]>
 
S

Singamsetty

yezi said:
Hi:

I code a main function in one file "nlp.c"
code defination of variabla in one file "nlp.h"

I use "

gcc nlp.c -o nlp.out ; no error message;

I use :

gcc nlp.c nlp.out nlp.h -lm ;

the message is :

compilation of header file requested


WOuld you give me some hint of that , thanks

Don't give ".h" files as arguments to gcc. Instead add

#include "nlp.h"

at the beginning of your nlp.c file. Now run

gcc nlp.c -lm -o nlp.out

- Hemanth
 
M

Mark McIntyre

I use :

gcc nlp.c nlp.out nlp.h -lm ;

the message is :

compilation of header file requested


WOuld you give me some hint of that , thanks

This is strictly a question about how gcc works, and isn't topical
here. One of hte gnu groups is a possible location to start.

However you may also want to think hard about what an include file is,
and how it gets included, and whether trying to compile it is actually
necessary.
 
M

Mark McIntyre

This is work

What is?

"Please quote enough of the previous message for context. To do so
from Google, click "show options" and use the Reply shown in the
expanded header."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,170
Messages
2,570,925
Members
47,466
Latest member
DrusillaYa

Latest Threads

Top