sdl2 - Unable to complete link: undefined reference to SDL_RenderGeometryRaw and SDL_SetTextureScaleMode

I’m facing this error on the linkage of executable, but the ojects file are created without error.
I’m trying to compile the: GitHub - CedricGuillemet/ImGuizmo: Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui with proper ImGui version but with sdl2 version 2.32.8.

I’m searching on google but without luck. I found a topic in the forum speaking about rpath and I don’t know how to setup this.

So, can anyone help with that undefined reference?
Thanks.

How are you compiling this? What operating system?

Make sure you’re linking to the right version of SDL 2. Older versions didn’t have those functions. Some Linux distros ship ridiculously ancient versions of SDL 2, and if you’re linking to one of those instead then that explains the linker errors.

C’s separate compilation model is why the object files aren’t getting the same error. When they get compiled, the compiler assumes functions outside the specific file getting compiled will be provided at the link stage. When they aren’t, the linker bombs out with an error about it.

My system is the old ubuntu 20.04, but I instaled the sdl2 version 2.32.8 just over the old 2.0.10. Maybe some files could be from the old sdl, but it not make sense. I tried to compile manually and with the makefile from the project and the same error happens, but the imgui whose I dowloaded runs fine without the imsequencer.

But I gave up, the project is overcomplicated and I don’t will use it.

Anyway, thanks for the reply!

Man, I did it! Now compiles without error:
–just added the parameter to the end of compile line: sdl2-config --cflags --libs
Before I was using only -lSDL2 for the linker.