Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error: no member named 'default_textured_vertex_shader_id' in 'struct GPU_Context' #213

Open
NODESPLIT opened this issue Jan 31, 2021 · 3 comments

Comments

@NODESPLIT
Copy link

Never had an issue compiling on this machine but just had this error compiling latest on master:

In file included from /Users/erroneous/sdl-gpu/src/renderer_OpenGL_1.c:23:
/Users/erroneous/sdl-gpu/src/renderer_GL_common.inl:1819:26: error: no member named 'default_textured_vertex_shader_id' in 'struct GPU_Context'
        target->context->default_textured_vertex_shader_id = v;
        ~~~~~~~~~~~~~~~  ^
/Users/erroneous/sdl-gpu/src/renderer_GL_common.inl:1820:26: error: no member named 'default_textured_fragment_shader_id' in 'struct GPU_Context'
        target->context->default_textured_fragment_shader_id = f;
        ~~~~~~~~~~~~~~~  ^
/Users/erroneous/sdl-gpu/src/renderer_GL_common.inl:1860:26: error: no member named 'default_untextured_vertex_shader_id' in 'struct GPU_Context'
        target->context->default_untextured_vertex_shader_id = v;
        ~~~~~~~~~~~~~~~  ^
/Users/erroneous/sdl-gpu/src/renderer_GL_common.inl:1861:26: error: no member named 'default_untextured_fragment_shader_id' in 'struct GPU_Context'
        target->context->default_untextured_fragment_shader_id = f;
        ~~~~~~~~~~~~~~~  ^
2 warnings and 4 errors generated.
make[2]: *** [src/CMakeFiles/SDL_gpu.dir/renderer_OpenGL_1.c.o] Error 1
make[1]: *** [src/CMakeFiles/SDL_gpu.dir/all] Error 2
make: *** [all] Error 2

Here's what CMake says while generating the makefiles:

CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Writing version header for v0.12.0
 Using Apple defaults.
-- Found SDL2: /usr/local/lib/libSDL2.dylib
CMake Warning at CMakeLists.txt:182 (message):
  SDL2MAIN_LIBRARY is NOTFOUND


-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework
 Using bundled version of GLEW
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libstbi'
--   No package 'libstbi' found
 Using bundled version of stb-image
-- Checking for module 'libstbi_write'
--   No package 'libstbi_write' found
 Using bundled version of stb-image-write
-- Configuring done
CMake Warning (dev):
  Policy CMP0068 is not set: RPATH settings on macOS do not affect
  install_name.  Run "cmake --help-policy CMP0068" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility with older versions of CMake, the install_name fields for
  the following targets are still affected by RPATH settings:

   SDL_gpu_shared

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/erroneous/sdl-gpu

SDL2MAIN_LIBRARY is NOTFOUND is a little odd as I'm pretty sure I've got SDL2 installed, especially considering it says -- Found SDL2: /usr/local/lib/libSDL2.dylib above it.

I'm on macOS Catalina 10.15.3, I'm also having trouble getting shaders to render in SDL_gpu right now but that's probably unrelated. This isn't a halting issue for me as I've got a working install already set up on here, wanted to make a note of it here though.

Thanks :)

@grimfang4
Copy link
Owner

The compile error is concerning, but the NOTFOUND warning should be fine. I don't think SDL uses SDL2main on Macs.

@pmp-p
Copy link

pmp-p commented Feb 24, 2021

i get the same error on pclinuxos with gcc 10.2.0 or clang 10.0.1

cosmo-ray added a commit to cosmo-ray/sdl-gpu that referenced this issue Apr 17, 2021
fix issue grimfang4#213

The problem seems to occure when sdl-gpu is installed, then CMakeList
was calling include_directories cmake function with SDL path before adding
project include/, So /usr/include/SDL had an higher priority than
sdl-gpu includes, and so it was using old versions include.

Signed-off-by: matthias <uso.cosmo.ray@gmail.com>
cosmo-ray added a commit to cosmo-ray/sdl-gpu that referenced this issue Apr 17, 2021
fix issue grimfang4#213

The problem seems to occur when sdl-gpu is installed, then CMakeList
was calling include_directories cmake function with SDL path before adding
project include/, So /usr/include/SDL had an higher priority than
sdl-gpu includes, and so it was using old versions,
which didn't have default_textured_vertex_shader_id.

Signed-off-by: matthias <uso.cosmo.ray@gmail.com>
@cosmo-ray
Copy link
Contributor

cosmo-ray commented Apr 22, 2021

I had the same error,
It seems the error was happening because the makefile include /usr/include/SDL_gpu.h before the repository SDL_gpu.h.
So using an old SDL_gpu.h to compile SDL_gpu made the compilation was failing.
A simple way to avoid the problem is simply to uninstall SDL_gpu when compiling it. (or use the patch from my PR)

teegee pushed a commit to teegee/sdl-gpu that referenced this issue Aug 11, 2023
fix issue grimfang4#213

The problem seems to occur when sdl-gpu is installed, then CMakeList
was calling include_directories cmake function with SDL path before adding
project include/, So /usr/include/SDL had an higher priority than
sdl-gpu includes, and so it was using old versions,
which didn't have default_textured_vertex_shader_id.

Signed-off-by: matthias <uso.cosmo.ray@gmail.com>
aliceisjustplaying pushed a commit to aliceisjustplaying/sdl-gpu that referenced this issue Aug 27, 2024
fix issue grimfang4#213

The problem seems to occur when sdl-gpu is installed, then CMakeList
was calling include_directories cmake function with SDL path before adding
project include/, So /usr/include/SDL had an higher priority than
sdl-gpu includes, and so it was using old versions,
which didn't have default_textured_vertex_shader_id.

Signed-off-by: matthias <uso.cosmo.ray@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants