Welcome! Log In Create A New Profile

Advanced

Compiling a library

Posted by CurlyPaul 
Compiling a library
December 10, 2008 11:57PM
Does anyone have any clear instructions on how to build a library using DevKitPro and Programmers notepad?

I've been looking around the web but all the answers that I can find to this question are one liners and are written as command lines. I'd like to read some sort of explanation of what needs to be done.

Thanks
Re: Compiling a library
December 11, 2008 06:53AM
Are you meaning to write your own "library" or cross-compile an existing one?
Re: Compiling a library
December 11, 2008 07:03AM
-static
Re: Compiling a library
December 11, 2008 10:09AM
@Tantric - I have some fucnctions that I wrote and I want to put them in a library so that I can re-use them.

@lordzid - Does that go in the makefile somewhere? and will it give me a file with the 'a' extension that I can put in the libogc folder and reference from future projects?
Re: Compiling a library
December 11, 2008 10:21AM
-static is a linker flag. If you can't figure it out from there, perhaps you should pursue a career in the arts instead.
Re: Compiling a library
December 11, 2008 10:43AM
Quote
lordzid
-static is a linker flag. If you can't figure it out from there, perhaps you should pursue a career in the arts instead.

That is about the most unhelpful, rude comment I've seen on this forum; how about you help the guy instead of acting like a know-it-all jackass?

Anyway CurlyPaul, this post might be help to you:
[forum.wiibrew.org]
Re: Compiling a library
December 11, 2008 10:57AM
Not having the intelligence to do your own research is counterproductive to programming, he needs to learn that now. Holding his hand will only get him hit by a car.

If I were CurlyPaul i'd be quite offended at your, frankly rude, evangelicalism.



Edited 1 time(s). Last edit at 12/11/2008 11:27AM by lordzid.
Re: Compiling a library
December 11, 2008 11:43AM
Strange, I didn't need that flag, i just needed to add a makefile goal for the libX.a file that had the object files as it's dependency.
Re: Compiling a library
December 11, 2008 11:47AM
Quote
henke37
Strange, I didn't need that flag, i just needed to add a makefile goal for the libX.a file that had the object files as it's dependency.

Are you invoking 'ar' or making shared lib instead?
Re: Compiling a library
December 11, 2008 02:39PM
Well thanks to all of you who tried to help (I'll check out the link later) and big fuck you to lordzid.

I did google it but like I said in op, all I found was a bunch of unhelpful elitist pricks talking in arguments rather than actually explaining anything.
Re: Compiling a library
December 11, 2008 03:48PM
Well, given the fact that it's kinda hard to use shared libraries on this particular platform, I can't have been using them.
Re: Compiling a library
December 11, 2008 03:49PM
Quote
henke37
Well, given the fact that it's kinda hard to use shared libraries on this particular platform, I can't have been using them.

You didn't say you weren't using ar.
Re: Compiling a library
December 11, 2008 04:44PM
adding the following line in your Makefile should (in theory, untested)work:

Quote

all:
powerpc-gekko-ar -rc "output.a" file1.o file2.o ...


@lordzid: it's a coding help forum, what is obvious for you may be not for others... oh btw, speaking about shared libraries and -static flag on the Wii could make you appears as quite ignorant yourself ;-)

Quote

Strange, I didn't need that flag, i just needed to add a makefile goal for the libX.a file that had the object files as it's dependency.

according to gcc doc:

Quote

`-static'
Do not link against shared libraries. This is only meaningful on
platforms for which shared libraries are supported
. The different
variants of this option are for compatibility with various
systems. You may use this option multiple times on the command
line: it affects library searching for `-l' options which follow
it. This option also implies `--unresolved-symbols=report-all'.
This option can be used with `-shared'. Doing so means that a
shared library is being created but that all of the library's
external references must be resolved by pulling in entries from
static libraries.



Edited 3 time(s). Last edit at 12/11/2008 05:03PM by ekeeke.
Re: Compiling a library
December 11, 2008 07:05PM
I would recommend against that make file, it will unconditionally rebuild the library file. Add the .a file as a dependency of "all" instead, that way make can do it's minimum update magic.
Sorry, only registered users may post in this forum.

Click here to login