problem with C

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
StevX

problem with C

Post 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
Cemre

Re:problem with C

Post 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
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:problem with C

Post by Solar »

Erm... you're putting C source files into a linker archive?

(Sitting back to wait whether you see your error yourself... ;) )
Every good solution is obvious once you've found it.
StevX

Thanks

Post by StevX »

Thanks a lot.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:problem with C

Post by Solar »

Without smiley, I have to ask: Does that mean you found the error, or are you sulking? ;)
Every good solution is obvious once you've found it.
Post Reply