sm64pc / sm64ex

Fork of https://github.com/sm64-port/sm64-port with additional features.
1.57k stars 486 forks source link

Error building GL_LEGACY for pi zero #483

Closed retropieuser closed 10 months ago

retropieuser commented 3 years ago

I'm getting an error when attempting to build a GL_LEGACY build for the pi0w.

/usr/bin/ld: build/us_pc/src/pc/gfx/gfx_opengl_legacy.o: in function gfx_opengl_unload_shader': gfx_opengl_legacy.c:(.text+0x4fc): undefined reference toglClientActiveTexture' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x514): undefined reference to glDisableClientState' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x51c): undefined reference toglClientActiveTexture' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x534): undefined reference to glDisableClientState' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x56c): undefined reference toglDisableClientState' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x584): undefined reference to glDisableClientState' /usr/bin/ld: build/us_pc/src/pc/gfx/gfx_opengl_legacy.o: in functiongfx_opengl_draw_triangles': gfx_opengl_legacy.c:(.text+0x750): undefined reference to glVertexPointer' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x7f8): undefined reference toglEnableClientState' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x80c): undefined reference to glColorPointer' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x850): undefined reference toglDisableClientState' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x870): undefined reference to glEnableClientState' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x884): undefined reference toglColorPointer' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x8a4): undefined reference to glAlphaFunc' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x8c8): undefined reference toglTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x8e0): undefined reference to glTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x8f0): undefined reference toglTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x900): undefined reference to glTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x910): undefined reference toglTexEnvi' /usr/bin/ld: build/us_pc/src/pc/gfx/gfx_opengl_legacy.o:gfx_opengl_legacy.c:(.text+0x920): more undefined references to glTexEnvi' follow /usr/bin/ld: build/us_pc/src/pc/gfx/gfx_opengl_legacy.o: in functiongfx_opengl_draw_triangles': gfx_opengl_legacy.c:(.text+0x974): undefined reference to glClientActiveTexture' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x984): undefined reference toglEnableClientState' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x998): undefined reference to glTexCoordPointer' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x9b8): undefined reference toglClientActiveTexture' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x9c8): undefined reference to glEnableClientState' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x9dc): undefined reference toglTexCoordPointer' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xa04): undefined reference to glTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xa3c): undefined reference toglTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xa58): undefined reference to glTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xa68): undefined reference toglTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xa78): undefined reference to glTexEnvi' /usr/bin/ld: build/us_pc/src/pc/gfx/gfx_opengl_legacy.o:gfx_opengl_legacy.c:(.text+0xa88): more undefined references toglTexEnvi' follow /usr/bin/ld: build/us_pc/src/pc/gfx/gfx_opengl_legacy.o: in function gfx_opengl_draw_triangles': gfx_opengl_legacy.c:(.text+0xb7c): undefined reference toglFogfv' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xb84): undefined reference to glEnableClientState' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xbac): undefined reference toglTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xbd0): undefined reference to glTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xbe0): undefined reference toglTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xbf0): undefined reference to glTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xc00): undefined reference toglTexEnvi' /usr/bin/ld: build/us_pc/src/pc/gfx/gfx_opengl_legacy.o:gfx_opengl_legacy.c:(.text+0xc10): more undefined references to glTexEnvi' follow /usr/bin/ld: build/us_pc/src/pc/gfx/gfx_opengl_legacy.o: in functiongfx_opengl_init': gfx_opengl_legacy.c:(.text+0xf24): undefined reference to glEnableClientState' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xf40): undefined reference toglTexEnvfv' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xf50): undefined reference to glTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xf60): undefined reference toglTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xf70): undefined reference to glTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0xf80): undefined reference toglTexEnvi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x1028): undefined reference to glFogi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x1034): undefined reference toglFogi' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x1040): undefined reference to glFogf' /usr/bin/ld: gfx_opengl_legacy.c:(.text+0x104c): undefined reference toglFogf' collect2: error: ld returned 1 exit status make: *** [Makefile:1048: build/us_pc/sm64.us.f3dex2e.arm] Error 1

Anyone got any ideas what the issue might be for this?

vanfanel commented 3 years ago

@retropieuser Don't waste your time with the GL_LEGACY version. Why would you do that? sm64ex-alo runs great on OpenGL_ES2, which the Pi0w fully supports. GL_LEGACY has a ton of graphical glitches, don't go that way.

WRT the errors you are seing, they come from the fact that sm64ex-alo isn't being linked against GL (-lOpenGL should be passed to the linker, to be precise. You will see -lGL in many places, but that's old and absurd as that would tie your executable to X11, which is a bad thing in this day an age).

You shouldn't be trying to build a GL_LEGACY version unless you have built SDL2 with desktop OpenGL (NOT GLES) support, which you may not have done. In a nutshell, build a normal GLES version and stop thinking about GL_LEGACY, that's not for a Pi usercase.

retropieuser commented 3 years ago

Okay I'll give a GLES version a shot. What I found is I'm basically hamstringed similar to the previous issue here:-

https://github.com/sm64pc/sm64ex/issues/27

But I haven't tried sm64-alo yet, the DPI screen issue might be solveable with this

vanfanel commented 3 years ago

@retropieuser In any case, sm64ex also works with GLES2. Simply build with:

make TARGET_RPI=1 -j4

..And the build system will take care of everything, building a GLES2 version for you.

It's what everybody uses to build Pi versions :) I guess you are missing TARGET_RPI=1 bit?

retropieuser commented 3 years ago

No I can build it with target_rpi. But the issue is the same as in #27 above. The video can't display if the Videocore 4 is not being used on the pi (which in the case of the retroflag GPI is a problem as you can't output to a dpi using vc4)

Hence why I saw if there's an ability to option to build with the legacygl support, that would fix the need for using vc4 in that particular setup.

Anyway will give it a shot with the alo fork and see if that works

vanfanel commented 3 years ago

@retropieuser Ah, so it's the case using GPIO video, which is not supported by the DRM/MESA driver. You will get identical results with sm64ex-alo, save your time.

But then again, OpenGL LEGACY won't change that fact: if you use the MESA driver (which is what you should use in any Pi), you won't get GPIO video, that's the same if you use GLES2 or LEGACY_GL.

Hyenadae commented 2 years ago

Yeah, sadly despite all my work last year (wow, it's been a while...) to get 'universal' Raspberry Pi compatibility, some hardware configurations simply won't work. I don't think there will be anything to change this mind you. HDMI out rendering with the right OS setup will work, either by my pisetup.sh script or by passing TARGET_RPI=1 and other configs you want (if anyone else sees this comment and issue report)

I do think it's a miracle I got it to run at 75-90% full speed on a Pi 1, as it ran OpenGLES natively accelerated without Xorg running, and had a bunch of GCC optimizations configured too (with an overclock to cheat further, but it was awesome as that meant a Pi 2 and newer could run it full screen, and a Pi 3 and Pi 4 with the right options could run it full speed in a Linux desktop environment too!)