Welcome! Log In Create A New Profile

Advanced

linking GX

Posted by g_man 
linking GX
December 26, 2009 07:41AM
So I reinstalled devkitpro on my usb stick, so that i could take my apps on the go, and work on them at differen't places. And i can't access my hard drive with my previous homebrew stuff on it, so it is a fresh installation.
I tried making a quick demo using the HOMEbrew menu, and i'm getting a linking error. When i take out the line that calls the HOMEbrew menu everything works fine. Here is the error.
f:/devkitPro/libogc/lib/wii\libwiisprite.a(sprite.o): In function `wsp::Sprite::Draw(float, float) const':
/home/chaosteil/code/wii/libwiisprite/source/sprite.cpp:422: undefined reference to `GX_Position2f32'
/home/chaosteil/code/wii/libwiisprite/source/sprite.cpp:423: undefined reference to `GX_Color4u8'
/home/chaosteil/code/wii/libwiisprite/source/sprite.cpp:424: undefined reference to `GX_TexCoord2f32'
/home/chaosteil/code/wii/libwiisprite/source/sprite.cpp:425: undefined reference to `GX_Position2f32'
/home/chaosteil/code/wii/libwiisprite/source/sprite.cpp:426: undefined reference to `GX_Color4u8'
/home/chaosteil/code/wii/libwiisprite/source/sprite.cpp:427: undefined reference to `GX_TexCoord2f32'
...
collect2: ld returned 1 exit status
make[1]: *** [/f/homebrew/Hometest/Hometest.elf] Error 1
"make": *** [build] Error 2
There are more error, but they are just repeated
I can tell it can't find a gx library, but what is the library called, isn't it included in -logc. here are my dependancies
LIBS	:=	-lhbmenu -lwiisprite -lpng -lz -lwiiuse -lbte -lfat -logc -lm

I'm tring to work with the bare minimum libraries, but i will add more as i go.
Also if it is really needed here is the source code:
#include wiiuse/wpad.h
#include wiisprite.h
#include hbmenuhead.h

// libwiisprite uses wsp as it's namespace
using namespace wsp;

int main(int argc, char **argv)
{
	// Create the game window and initalise the VIDEO subsystem
	GameWindow *gwd = new GameWindow;
	gwd->InitVideo();
	
	gwd->SetBackground((GXColor){ 255, 255, 255, 255 });

	// Initialise Wiimote
	WPAD_Init();

	for(;;)
	{
		WPAD_ScanPads();
		if(WPAD_ButtonsDown(WPAD_CHAN_0)&WPAD_BUTTON_HOME)
			homemenu(gwd);
		gwd->Flush();
	}
	return 0;
}
Thanks
Re: linking GX
December 26, 2009 02:58PM
You need to recompile and then reinstall libwiisprite.

I have a build recompiled under r19 hosted here: [arikadosblog.blogspot.com]

Also, be aware that some of the libwiisprite documentation no longer applies to it under a more recent compilation such as this.
Re: linking GX
December 26, 2009 06:47PM
Thanks, i was going to try rebulilding those from source next.
Also, if it uses the same source code, what would change in documentation it wouldn't be anything in the classes, would it?
Re: linking GX
December 26, 2009 06:52PM
The only major difference is how you must externally load images.

Before, the default loading directory was the root of the location of the executable.
Now, you must define the full path.

If that sounds confusing, take a look at the code:
//The old loading method. This does NOT work!!!
Image->LoadImage("myimage.png");

//This is how images must be loaded instead now:
Image->LoadImage("sd:/apps/applocation/myimage.png");
Re: linking GX
December 27, 2009 03:38AM
Thats not confusing at all. But thats probably because I am a computer guy.
Sorry, only registered users may post in this forum.

Click here to login