[Alug] oreilly, static linking & UEA meetings

LxS Alexis.Lee at uea.ac.uk
Tue May 22 17:08:00 BST 2001

DF sparked my interest in system-stylee programming again, so I have a
couple of questions:

a) At the last UEA meeting, I heard ALUG had been offered a 25% O'Reilly
discount. I thought, mmm, munch. Is this going to be honoured as an
ALUG-library only option, or if I come up with a huge order can I route
it thru ALUG?

b) I'm trying to build and link against a static library:
		gcc -g -Wall -o libdog.o libdog.c
		ar rcs libdog.a libdog.o
		gcc -g -Wall -o sll.o sll.c
		ld -L. -ldog -o sll sll.o

		void speak() { printf("Arf!\n"); }

		[extern] void speak();
		int main(int argc, char** argv) { speak(); return 0; }

The ld command warns me that it can't find a _start symbol, then wibbles
about undefined symbol speak. It definitely finds libdog.a though
(from -verbose), and nm libdog.a reports something very much like:

	00000000	t Letext
				U printf
	00000006	T speak

I've tried it with and without extern. Given I figured out how to build
& link shared libraries for JNI, on AIX, with only man pages, I'm
feeling fairly annoyed at myself for not being able to do statics with a
big book in front of me. Help!

Finally, I might be able to help out with organising UEA ALUG meetings.
Being a student, I go onto campus pretty regularly anyway. Mail me, MJR.

"C++ : an octopus made by nailing extra legs onto a dog" 
"Resolve first your body and mind, your private relationships and your public
  ones. The state will soon follow." - Confucian-esque
"I find that the harder I work, the more luck I seem to have" - T Jefferson

More information about the main mailing list