![]() |
|
Cant load bitmap on CLion (Cmake) |
Lox Chatterbox
Member #20,176
May 2021
|
I can run allegro 4 on Code::Blocks and load bitmaps without any issues like so: #include <allegro.h> int main() { set_color_depth(16); //load BMP blit(image, screen, 0, 0, 0, 0, image->w, image->h); When I try to run it on CLion, the code executes but I can't figure out how to add a bitmap to my CMake. Here's the current CMake: cmake_minimum_required(VERSION 3.24) set(CMAKE_C_STANDARD 99) add_executable(allegro_test main.c)
target_link_libraries(allegro_test -lalleg44) set (R_DIR "/images")
configure_file(C:/Users/lasbo/CLionProjects/allegro_test/images/dvdlogo.bmp ${CMAKE_CURRENT_BINARY_DIR} COPYONLY) include_directories(${PROJECT_SOURCE_DIR} images) Does anyone know any way to load bmps with Clion/CMake? |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Your working directory is probably off. Try running your program from the directory expected by your program's bitmap loading code. CLion probably has a setting somewhere for working directory at run time. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|