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

Not building on ArchLinux #34

Open
juliancoffee opened this issue Apr 6, 2021 · 1 comment
Open

Not building on ArchLinux #34

juliancoffee opened this issue Apr 6, 2021 · 1 comment

Comments

@juliancoffee
Copy link

The project isn't building on ArchLinux because of CMake issues (or probably Arch Linux issues)

Steps to reproduce: (just building steps from README + logging)

git clone https://github.com/ggerganov/kbd-audio
cd kbd-audio
git submodule update --init
mkdir build && cd build
cmake .. &> cmake_log
make &>make_log

Now content of cmake_log

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.31.1") 
CMake Warning (dev) at /usr/share/cmake-3.20/Modules/FindOpenGL.cmake:315 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:69 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib/libOpenGL.so   
-- Found FFTW: /usr/lib/libfftw3.so;/usr/lib/libfftw3f.so  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/julian/Workspace/repos/kbd-audio/build

And make_log

[  3%] Building CXX object CMakeFiles/Core.dir/common.cpp.o
[  6%] Building CXX object CMakeFiles/Core.dir/audio_logger.cpp.o
/home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:8:10: fatal error: SDL.h: No such file or directory
    8 | #include <SDL.h>
      |          ^~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/Core.dir/build.make:90: CMakeFiles/Core.dir/audio_logger.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/Core.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I have SDL2 installed and even have SDL.h file (in /usr/include) so it should work, but it isn't. As a workaround, I added this to CMakeLists.txt
include_directories(/usr/include/SDL2)
Then cmake_log looks the same, but make_log shows this

[  3%] Building CXX object CMakeFiles/Core.dir/common.cpp.o
[  6%] Building CXX object CMakeFiles/Core.dir/audio_logger.cpp.o
[  9%] Linking CXX static library libCore.a
[  9%] Built target Core
[ 12%] Building CXX object CMakeFiles/Gui.dir/common-gui.cpp.o
[ 15%] Building CXX object CMakeFiles/Gui.dir/imgui/imgui.cpp.o
[ 18%] Building CXX object CMakeFiles/Gui.dir/imgui/imgui_draw.cpp.o
[ 21%] Building CXX object CMakeFiles/Gui.dir/imgui/imgui_demo.cpp.o
[ 24%] Building CXX object CMakeFiles/Gui.dir/imgui/imgui_widgets.cpp.o
[ 27%] Building C object CMakeFiles/Gui.dir/imgui/examples/libs/gl3w/GL/gl3w.c.o
[ 30%] Building CXX object CMakeFiles/Gui.dir/imgui/examples/imgui_impl_sdl.cpp.o
[ 33%] Building CXX object CMakeFiles/Gui.dir/imgui/examples/imgui_impl_opengl3.cpp.o
[ 36%] Linking CXX static library libGui.a
[ 36%] Built target Gui
[ 39%] Building CXX object CMakeFiles/keytap2-gui.dir/keytap2-gui.cpp.o
/home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp: In lambda function:
/home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1755:29: warning: unused variable ‘tStart’ [-Wunused-variable]
 1755 |                 static auto tStart = t_ms();
      |                             ^~~~~~
/home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1810:22: warning: unused variable ‘tEnd’ [-Wunused-variable]
 1810 |                 auto tEnd = t_ms();
      |                      ^~~~
[ 42%] Building CXX object CMakeFiles/keytap2-gui.dir/subbreak2.cpp.o
/home/julian/Workspace/repos/kbd-audio/subbreak2.cpp:337:18: warning: ‘std::vector<int> {anonymous}::subset(int, int)’ defined but not used [-Wunused-function]
  337 | std::vector<int> subset(int k, int n) {
      |                  ^~~~~~
[ 45%] Linking CXX executable keytap2-gui
/usr/bin/ld: CMakeFiles/keytap2-gui.dir/keytap2-gui.cpp.o: in function `prepareAudioOut(stParameters const&)':
/home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1191: undefined reference to `SDL_Init'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1196: undefined reference to `SDL_GetNumAudioDevices'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1199: undefined reference to `SDL_GetAudioDeviceName'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1208: undefined reference to `SDL_memset'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1218: undefined reference to `SDL_memset'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1220: undefined reference to `SDL_GetAudioDeviceName'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1220: undefined reference to `SDL_OpenAudioDevice'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1233: undefined reference to `SDL_PauseAudioDevice'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1192: undefined reference to `SDL_GetError'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1192: undefined reference to `SDL_LogError'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1222: undefined reference to `SDL_GetError'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1222: undefined reference to `SDL_LogError'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1223: undefined reference to `SDL_Quit'
/usr/bin/ld: CMakeFiles/keytap2-gui.dir/keytap2-gui.cpp.o: in function `renderKeyPresses(stStateUI&, std::vector<short, std::allocator<short> > const&, stKeyPressCollection<short>&)':
/home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:660: undefined reference to `SDL_PauseAudioDevice'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:666: undefined reference to `SDL_ClearQueuedAudio'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:668: undefined reference to `SDL_PauseAudioDevice'
/usr/bin/ld: CMakeFiles/keytap2-gui.dir/keytap2-gui.cpp.o: in function `main::{lambda()#6}::operator()() const':
/home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1448: undefined reference to `SDL_PollEvent'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1468: undefined reference to `SDL_GetWindowID'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1448: undefined reference to `SDL_PollEvent'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1475: undefined reference to `SDL_GetWindowSize'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1464: undefined reference to `SDL_free'
/usr/bin/ld: CMakeFiles/keytap2-gui.dir/keytap2-gui.cpp.o: in function `std::_Function_handler<void (int, int), main::{lambda(int, int)#5}>::_M_invoke(std::_Any_data const&, int&&, int&&)':
/home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1354: undefined reference to `SDL_SetWindowSize'
/usr/bin/ld: CMakeFiles/keytap2-gui.dir/keytap2-gui.cpp.o: in function `main':
/home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1262: undefined reference to `SDL_Init'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/keytap2-gui.cpp:1263: undefined reference to `SDL_GetError'
/usr/bin/ld: libCore.a(audio_logger.cpp.o): in function `AudioLogger::install(AudioLogger::Parameters&&)':
/home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:167: undefined reference to `SDL_Init'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:172: undefined reference to `SDL_GetNumAudioDevices'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:175: undefined reference to `SDL_GetAudioDeviceName'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:184: undefined reference to `SDL_memset'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:194: undefined reference to `SDL_memset'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:196: undefined reference to `SDL_GetAudioDeviceName'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:197: undefined reference to `SDL_GetAudioDeviceName'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:197: undefined reference to `SDL_OpenAudioDevice'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:233: undefined reference to `SDL_PauseAudioDevice'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:168: undefined reference to `SDL_GetError'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:168: undefined reference to `SDL_LogError'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:199: undefined reference to `SDL_GetError'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:199: undefined reference to `SDL_LogError'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:200: undefined reference to `SDL_Quit'
/usr/bin/ld: libCore.a(audio_logger.cpp.o): in function `AudioLogger::terminate()':
/home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:263: undefined reference to `SDL_PauseAudioDevice'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:264: undefined reference to `SDL_CloseAudioDevice'
/usr/bin/ld: libCore.a(audio_logger.cpp.o): in function `AudioLogger::pause()':
/home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:383: undefined reference to `SDL_PauseAudioDevice'
/usr/bin/ld: libCore.a(audio_logger.cpp.o): in function `AudioLogger::resume()':
/home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:391: undefined reference to `SDL_PauseAudioDevice'
/usr/bin/ld: libCore.a(audio_logger.cpp.o): in function `AudioLogger::addFrame(float const*)':
/home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:274: undefined reference to `SDL_GetQueuedAudioSize'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:275: undefined reference to `SDL_GetQueuedAudioSize'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/audio_logger.cpp:276: undefined reference to `SDL_ClearQueuedAudio'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_Init(SDL_Window*)':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:170: undefined reference to `SDL_CreateSystemCursor'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:171: undefined reference to `SDL_CreateSystemCursor'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:172: undefined reference to `SDL_CreateSystemCursor'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:173: undefined reference to `SDL_CreateSystemCursor'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:174: undefined reference to `SDL_CreateSystemCursor'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o):/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:175: more undefined references to `SDL_CreateSystemCursor' follow
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_Init(SDL_Window*)':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:181: undefined reference to `SDL_GetCurrentVideoDriver'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_GetClipboardText(void*)':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:71: undefined reference to `SDL_free'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:72: undefined reference to `SDL_GetClipboardText'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_ProcessEvent(SDL_Event const*)':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:117: undefined reference to `SDL_GetModState'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:118: undefined reference to `SDL_GetModState'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:119: undefined reference to `SDL_GetModState'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:123: undefined reference to `SDL_GetModState'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_Shutdown()':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:228: undefined reference to `SDL_free'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:233: undefined reference to `SDL_FreeCursor'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_NewFrame(SDL_Window*)':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:351: undefined reference to `SDL_GetWindowSize'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:352: undefined reference to `SDL_GetWindowFlags'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:354: undefined reference to `SDL_GL_GetDrawableSize'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:361: undefined reference to `SDL_GetPerformanceCounter'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:248: undefined reference to `SDL_GetMouseState'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_UpdateMousePosAndButtons':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:255: undefined reference to `SDL_GetKeyboardFocus'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:275: undefined reference to `SDL_CaptureMouse'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_NewFrame(SDL_Window*)':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:297: undefined reference to `SDL_SetCursor'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_UpdateMouseCursor':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:298: undefined reference to `SDL_ShowCursor'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_NewFrame(SDL_Window*)':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:310: undefined reference to `SDL_GameControllerOpen'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_UpdateGamepads':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:321: undefined reference to `SDL_GameControllerGetButton'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:322: undefined reference to `SDL_GameControllerGetButton'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:323: undefined reference to `SDL_GameControllerGetButton'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:324: undefined reference to `SDL_GameControllerGetButton'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:325: undefined reference to `SDL_GameControllerGetButton'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o):/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:326: more undefined references to `SDL_GameControllerGetButton' follow
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_UpdateGamepads':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:333: undefined reference to `SDL_GameControllerGetAxis'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:334: undefined reference to `SDL_GameControllerGetAxis'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:335: undefined reference to `SDL_GameControllerGetAxis'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:336: undefined reference to `SDL_GameControllerGetAxis'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_UpdateMousePosAndButtons':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:243: undefined reference to `SDL_WarpMouseInWindow'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_NewFrame(SDL_Window*)':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:360: undefined reference to `SDL_GetPerformanceFrequency'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_UpdateMouseCursor':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:292: undefined reference to `SDL_ShowCursor'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_UpdateMousePosAndButtons':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:264: undefined reference to `SDL_GetWindowPosition'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:265: undefined reference to `SDL_GetGlobalMouseState'
/usr/bin/ld: libGui.a(imgui_impl_sdl.cpp.o): in function `ImGui_ImplSDL2_SetClipboardText(void*, char const*)':
/home/julian/Workspace/repos/kbd-audio/imgui/examples/imgui_impl_sdl.cpp:78: undefined reference to `SDL_SetClipboardText'
/usr/bin/ld: libGui.a(common-gui.cpp.o): in function `Gui::init(char const*, int, int, Gui::Objects&)':
/home/julian/Workspace/repos/kbd-audio/common-gui.cpp:46: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:47: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:48: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:49: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:53: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: libGui.a(common-gui.cpp.o):/home/julian/Workspace/repos/kbd-audio/common-gui.cpp:54: more undefined references to `SDL_GL_SetAttribute' follow
/usr/bin/ld: libGui.a(common-gui.cpp.o): in function `Gui::init(char const*, int, int, Gui::Objects&)':
/home/julian/Workspace/repos/kbd-audio/common-gui.cpp:57: undefined reference to `SDL_GetCurrentDisplayMode'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:63: undefined reference to `SDL_CreateWindow'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:66: undefined reference to `SDL_GL_CreateContext'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:67: undefined reference to `SDL_GL_MakeCurrent'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:68: undefined reference to `SDL_GL_SetSwapInterval'
/usr/bin/ld: libGui.a(common-gui.cpp.o): in function `Gui::render(Gui::Objects const&)':
/home/julian/Workspace/repos/kbd-audio/common-gui.cpp:161: undefined reference to `SDL_GL_MakeCurrent'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:166: undefined reference to `SDL_GL_SwapWindow'
/usr/bin/ld: libGui.a(common-gui.cpp.o): in function `Gui::free(Gui::Objects const&)':
/home/julian/Workspace/repos/kbd-audio/common-gui.cpp:176: undefined reference to `SDL_GL_DeleteContext'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:177: undefined reference to `SDL_DestroyWindow'
/usr/bin/ld: /home/julian/Workspace/repos/kbd-audio/common-gui.cpp:178: undefined reference to `SDL_Quit'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/keytap2-gui.dir/build.make:117: keytap2-gui] Error 1
make[1]: *** [CMakeFiles/Makefile2:158: CMakeFiles/keytap2-gui.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

In other words, make can't find .so file.

I found this working. In target_link_libraries I changed ${SDL2_LIBRARIES} to SDL2::SDL2 and now it works.

In case anyone will have this problem, here is my workaround in simple patch.
0001-Workaround-to-compile-on-archlinux.txt

@Dari0GR
Copy link

Dari0GR commented May 4, 2022

Amigo buen dia. Cuando ejecuto "make" comienza a cargar del 1 al 100% pero en el 28% me muestra :
/Users/dariogr/Desktop/kbd-audio/keytap-gui.cpp:618:28: warning: variable 'curosum' set but not used [-Wunused-but-set-variable]
double curosum = 0.0;
^
1 warning generated.
Y en el 60% me muestra:

/Users/dariogr/Desktop/kbd-audio/keytap.cpp:499:28: warning: variable 'curosum' set but not used [-Wunused-but-set-variable]
double curosum = 0.0;
^
/Users/dariogr/Desktop/kbd-audio/keytap.cpp:566:99: warning: format specifies type 'long' but the argument has type 'long long' [-Wformat]
printf(" Adding waveform %d - cc = %g, offset = %ld\n", iwaveform, cc, offset);

%lld

Podrías ayudarme por favor. Saludos

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

2 participants