Skip to content

Cmake Build Issues on Arch Based Linux. #7

@Zeludon

Description

@Zeludon

Hey I followed the build instructions included in the readme, adapting the packages for what is available on Arch

This guide was used for the switch packages and they (switch-dev switch-bzip2 switch-freetype switch-glad switch-glm switch-libdrm_nouveau switch-libpng switch-mesa switch-pkg-config switch-sdl2 switch-zlib ) all installed successfully.

The linux build packages libsdl2-dev libfreetype6-dev libglm-dev were replaced by their pacman equivalents, sdl2 freetype2 glm as arch does not use separate dev packages.

Unfortunately, attempting to build with DBUILD_LINUX=1 results in the following

make texture.elf  
Scanning dependencies of target texture.data
[  0%] Built target texture.data
[ 97%] Built target cross2d
Scanning dependencies of target texture.elf
[ 98%] Linking CXX executable texture.elf
/usr/bin/ld: ../../libcross2d/libcross2d.a(gl_renderer.cpp.o): in function `c2d::GLRenderer::draw(c2d::VertexArray*, c2d::Transform const&, c2d::Texture const*)':
gl_renderer.cpp:(.text+0x80c): undefined reference to `SDL_GL_GetDrawableSize'
/usr/bin/ld: ../../libcross2d/libcross2d.a(sdl2_gl_renderer.cpp.o): in function `c2d::SDL2Renderer::SDL2Renderer(c2d::Vector2<float> const&)':
sdl2_gl_renderer.cpp:(.text+0x71): undefined reference to `SDL_Init'

#... many more lines of sdl2 related errors

collect2: error: ld returned 1 exit status
make[3]: *** [examples/texture/CMakeFiles/texture.elf.dir/build.make:90: examples/texture/texture.elf] Error 1
make[2]: *** [CMakeFiles/Makefile2:310: examples/texture/CMakeFiles/texture.elf.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:322: examples/texture/CMakeFiles/texture.elf.dir/rule] Error 2
make: *** [Makefile:183: texture.elf] Error 2

Similarly building the switch package with DBUILD_SWITCH=1 results in a different error

make texture.nro
[  0%] Built target texture.data
Scanning dependencies of target cross2d
[  1%] Building CXX object libcross2d/CMakeFiles/cross2d.dir/source/skeleton/audio.cpp.o
In file included from /home/USER/libcross2d-examples/libcross2d/source/skeleton/audio.cpp:7:
/home/USER/libcross2d-examples/libcross2d/include/cross2d/c2d.h:136:10: fatal error: switch.h: No such file or directory
 #include <switch.h>
          ^~~~~~~~~~
compilation terminated.
make[3]: *** [libcross2d/CMakeFiles/cross2d.dir/build.make:63: libcross2d/CMakeFiles/cross2d.dir/source/skeleton/audio.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:96: libcross2d/CMakeFiles/cross2d.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:482: examples/texture/CMakeFiles/texture.nro.dir/rule] Error 2
make: *** [Makefile:248: texture.nro] Error 2

It would be very much appreciated if I could be pointed in the right direction on how to fix this, aside from switching linux distributions, as that really shouldn't be necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions