Newbie: libProblem.a
Bobak Csaba
h531649@sirius.cab.u-szeged.hu
Tue May 2 08:19:00 GMT 2000
Hi all!
After searching the archives I have to ask this:
How do I compile my prg of two libs and an executable if one of the libs
calls functions from the other one?
Simplified case:
a.c:
...
int foo_a(int x)
{
return x+1;
}
...
b.c:
...
extern foo_a(int);
...
int foo_b(int y)
{
return foo_a(y-1);
}
...
main.c:
...
extern foo_b(int);
...
cout<<foo_b(3);
...
What I tried:
gcc -c a.c
ar cq liba.a a.o
ranlib liba.a
gcc -c b.c
ar cq libb.a b.o
ranlib libb.a
gcc -o main main.c -L. -la -lb
The last command gave an 'undefined' with foo_a
What did I do wrong?
Csaba
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
More information about the Cygwin
mailing list