program slower with .so lib

Hello,

my 1st post =)

I was wondering if someone here can explain to me why a program that I wrote runs significantly slower when I link parts of the code as a static library instead of directly including the code in the project?

I assumed that function calls are resolved at compile time in both cases, so it really shouldn't matter if the code is right inside the project or in a separate static library file, or am I wrong?

I'm using g++ and Ubuntu/Linux 11.04, GCC4.5.

Kind Regards
It shouldn't matter unless the static lib was built with slower options (are you linking against the debug lib?)
Can you give a simple example of the code, how you compile it, and what the speed differences are?

.so is not static btw, it is shared.
Now that it's been pointed out that a *.so is a shared library, not static, does it make sense to you? The majority of the work of linking is not done at compile time, but at loadtime or runtime.
.so is not static btw, it is shared.

I confuse this all the time (but I tried both).

It shouldn't matter unless the static lib was built with slower options...

That was it, man, such an obvious thing... Anyway I am new to this so thank you all for your answers!
Topic archived. No new replies allowed.