multiple C source files howto
Ok ..
So how would you do this under linux: You have a program and you want cirtain "functions" to be in sepparate source files .. how would you compile this program ? i.e: main.c : contains "main" function which calls function 'test", includes "prog.h" prog.h : definition for function "test" test.c : body of function test ? |
It can be as simple as:
Code:
$ gcc -o program main.c test.c Code:
$ gcc -c main.c |
Quote:
I think you mean that the *declaration* is in prog.h Code:
/* declaration */ |
All times are GMT -5. The time now is 05:12 PM. |