Category : sdl-2

I’ve used SDL2_Mixer to play sound on Linux Ubuntu 16.04. Here is my class code. bool SoundPlayer::init() { if (SDL_Init(SDL_INIT_AUDIO) < 0) { LOG(ERROR)<<"init failed.n"; } LOG(INFO)<<"Speaker SDL init succeeded."; volume = DEFAULT_VOLUME; if(Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 4096) == -1) { LOG(ERROR)<<"audio not found,"<<Mix_GetError(); is_init = false; } else { is_init = true; } return is_init; ..

Read more

I’ve been trying to compile a SDL2 program that uses SDL_image to load a PNG animation, but I’m getting the error Game.cpp:(.text+0x146):undefined reference for "IMG_Load", my distro is Arch Linux and here is my CMakeLists.txt: cmake_minimum_required(VERSION 3.7) project(main) find_package(SDL2 REQUIRED SDL2_IMAGE REQUIRED) include_directories(${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIRS}) add_executable(main main.cpp Game.cpp) target_link_libraries(main ${SDL2_LIBRARIES} ${SDL2IMAGE_LIBRARIES}) I don’t know if the ..

Read more

At the moment I’m trying to learn game development with SDL. I’ve installed the SDL2 library and SDL2_image library with homebrew and coding with Xcode. A problem I keep encountering is that everytime I build the project, I keep seeing the same SIGABRT message: dyld`__abort_with_payload: 0x10006ded4 <+0>: movl $0x2000209, %eax ; imm = 0x2000209 0x10006ded9 ..

Read more