views:

68

answers:

2

Hello, this is my main question:

How do you create, compile and use static and dynamic libraries in linux-like systems? What is the difference between them?

Are there any good free tutorials explaining this stuff for a total idiota like me. I've only done c# programming before. I know a little C, C++ and Objective-C. I'm developing for iPhone but I'm trying to compile several libraries for the iPhone without much success. I understand so far (well at least the very basics) what a makefile is and how to modify one, I think i can create a static library using the following: ar file1.o file2.o, i though i had to do CC file1.o file2.o because they had to be linked together using some magic. In C# it was really simple you get the dll add reference and you're done. Here it seems so complicated.
Another question: How can i cross compile to another platform ARM for example? Especially those libraries which don't have that ./configure thingy (which I know nothing about) for arm already set up.
Yet another one: What is CFLAGS = -isysroot path/to/some/sdk? What does it do?

+3  A: 

How to Write Shared Libraries is about the best introduction to the topic that I've found.

High Performance Mark
uhmm...it doesn't work
kudor gyozo
Sorry, I've fixed the link now.
High Performance Mark
>=-- Thanks --=<
kudor gyozo
I'd add http://tldp.org/HOWTO/Program-Library-HOWTO/ as well as that .pdf
nos
+1  A: 

I found this tutorial quite helpful. It has step-by-step instructions for building a shared object dynamic library. It has a couple minor mistakes in its example code and commands, but at least it has example code and commands.

Evan Kroske