gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > Building a library

#8031 - xelius - Tue Jul 01, 2003 1:05 am

Hey,

I'm trying to use DevKitAdv to build a library but for some reason when I specify -shared for gcc it does not accept the option and ld outputs an error which says that -shared is not supported. Anybody know what I'm doing wrong?

Thanks.
_________________
-=xelius=-

#8036 - tepples - Tue Jul 01, 2003 2:12 am

Loading a shared library requires support from the operating system. The GBA BIOS has no such support.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#8060 - xelius - Tue Jul 01, 2003 2:11 pm

Yeah, stupid me. Using the wrong option, but then what option should I use?
_________________
-=xelius=-

#8112 - Drago - Wed Jul 02, 2003 12:26 pm

Roughly explained: to build a library you need to compile with -c option to avoid linking. Then you will get a set of object files that need to be archived using the ar command. This will produce something like library.a that you can link against other projects.

#8119 - xelius - Wed Jul 02, 2003 2:11 pm

Cool. Thanks very much :-)
_________________
-=xelius=-