gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] Confused about shared libraries


From: Martin Kalbfuß
Subject: [Gm2] Confused about shared libraries
Date: Fri, 02 Oct 2009 15:40:48 +0200

Hi,

I still don't understand the linking process completely.

If I want to create a static library, I have to do

gm2 -c *.mod.

I get the object files.
These object files together with the definition modules give me a fully
functional static library.

ut I'm still not sure how to create a shared library. I assumed

gm2 -c -fPIC *.mod

to get position independent  objects. IS this the way to go, or do I
miss something here?

When I want to link with a static library I simply set GM2IPATH to the
libraries directory.

export GM2IPATH="path_to_library_objects_and_definitions"
gm2 -I. -fmakeall -o program program.mod

Right?

But how to tell gm2 to link dynamically?

When I created position independent objects. With the command above. And
then do

export GM2IPATH="path_to_library_objects_and_definitions"
gm2 -I. -fmakeall -o program program.mod

I think it still links these objects statically.

So this isn't it.

I miss an option. Maybe -L and -l like gcc uses it?

It's a bit confusing because gm2 doesn't has libraries like I know from
C.

Thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]