unrefined reference to gluPerspective with OpenGX

Post Reply
User avatar
gofastlily
Posts: 2
Joined: Wed May 08, 2024 5:29 pm
Contact:

unrefined reference to gluPerspective with OpenGX

Post by gofastlily » Sat Nov 02, 2024 9:59 pm

Not sure if this is the right place to ask, but I ran into this issue trying to implement OpenGX in a small GameCube project.

How should I go about fixing this? I'm not entirely sure what next steps for debugging are here.

The full error thrown when running make is:

Code: Select all

/opt/devkitpro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.1.0/../../../../powerpc-eabi/bin/ld: CMakeFiles/GameCubeTemplate.dir/source/main.o: in function `SDL_main':
/Users/lily/projects/gamecube-template/source/main.cpp:81:(.text.SDL_main+0xe0): undefined reference to `gluPerspective'

glu.h exists in the dkp portlibs directory, so I'm not sure why it's not getting picked up.

Code: Select all

$> grep -E "gluPerspective" ${DEVKITPRO}/portlibs/gamecube/include/GL/glu.h 
GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);

Here's a link to the diff where I try and add OpenGX with the very beginnings of configuration.

https://github.com/gofastlily/gamecube- ... n...opengx

I'll admit I'm no C++ developer so I may be missing something simple here.

I installed opengx following the instructions in its readme. I'm loosely following the copy of NeHe's Lesson 07 that's in that repo, for what it's worth.

Please let me know if there's any other information that would be useful here.

Thanks,
Lily


WinterMute
Site Admin
Posts: 1970
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: unrefined reference to gluPerspective with OpenGX

Post by WinterMute » Sun Nov 03, 2024 3:09 pm

The CMakery you've added to your project is wrong. You should use the dkP supplied cmakery and not add random cmake files to your projects like this then try to add libraries manually.

I've PR'd changes that get your project building and linking and made some tweaks to dkP supplied packages to help. See https://github.com/gofastlily/gamecube-template/pull/1 - just squash & merge, the individual commits aren't important.

Help keep devkitPro toolchains free, Donate today

Personal Blog

User avatar
gofastlily
Posts: 2
Joined: Wed May 08, 2024 5:29 pm
Contact:

Re: unrefined reference to gluPerspective with OpenGX

Post by gofastlily » Sun Nov 03, 2024 3:41 pm

Oh, woah, thanks for the quick reply!

Clearly I've got a ton of learning to do 😅

Thanks for wrangling the CMake files for me, as you can probably tell I was more than a little confused.

Did I miss documentation on using CMake with dkP somewhere? I didn't catch anything on the wiki or Github.


Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests