RE: libraries
RE: libraries
- Subject: RE: libraries
- From: email@hidden
- Date: Mon, 21 Jul 2003 13:53:53 +0100
Phillip,
Have you tried making the library filename follow the formt libx.a (in your
case libadder.a)
I had a low of trouble with this until I changed from funkylib.a to
libfunky.a
HTH
Alun Carp
Driver Development Team leader
Data Encryption Systems Limited
-----Original Message-----
From: Philip George [
mailto:email@hidden]
Sent: 20 July 2003 23:42
To: cocoa dev
Subject: libraries
Ok, I've just wrecked my eyes and brain reading through the man pages for
both gcc and ld, and I still can't quite get my head around how to do
something that i KNOW has got to be really simple.
All I want to do is build a library (in standard C) with a couple of
functions in it, then include it in my project, and use it.
For testing, I've been just using one dummy function:
int adder(int a, int b) {
return (a+b);
}
I compiled like this first:
gcc adder.c -object
which wouldn't work, because gcc wanted me to use the "-static" flag. So
then I tried:
gcc adder.c -static -object
which couldn't find some symbol(s), so I did:
gcc adder.c -nostdlib -static -object
which compiled without warnings or errors.
I renamed "a.out" to "adderlib" and added it to my little test cocoa obj-c
project and tried to compile. I got:
Undefined symbols: _adder
So then I opened the project target and dropped the adderlib file from the
file list into the "Frameworks and Libraries" list.
Same result. Couldn't find the symbol "_adder" (my function name).
What am I doing wrong here?
Keep in mind I want this to be a static library that gets completely
embedded into the final cocoa app. I don't want it to have to link it in
dynamically on every launch.
Thanks.
- Philip
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.