Page 1 of 1

problem with C

Posted: Thu Nov 04, 2004 6:52 am
by StevX
- Hello!

I have a problem with compiling my C code. When I link it with any library (made by me - created with ar rcs x.c d.c) it is not functional. But If I pack all the code into main.c, all is OK.

format: coff-go32
I use GRUB

Re:problem with C

Posted: Thu Nov 04, 2004 8:07 am
by Cemre
making methods "static" may cause that

do this:
int method ( int a ) { ... }
instead of:
static int method ( int a ) { ... }
in the library,

also dont forget to include a prototype in main.c

Re:problem with C

Posted: Thu Nov 04, 2004 8:57 am
by Solar
Erm... you're putting C source files into a linker archive?

(Sitting back to wait whether you see your error yourself... ;) )

Thanks

Posted: Fri Nov 05, 2004 6:48 am
by StevX
Thanks a lot.

Re:problem with C

Posted: Fri Nov 05, 2004 7:48 am
by Solar
Without smiley, I have to ask: Does that mean you found the error, or are you sulking? ;)