gcc - undefined reference to xxxxx


This is my first attempt to use Raylib (I really enjoyed how this library is made), but when I try to compile the .c file with gcc (mingw) I get undefined references like "raylib-2.0.0-Win64-mingw\lib/libraylib.a(wgl_context.c.obj):wgl_context.c:(.text+0x1026): undefined reference to `__imp_DescribePixelFormat'".

I'm using this line command: gcc -o simple simple_game.c -IC:\Users\Cesar\Downloads\raylib-2.0.0-Win64-mingw\include -LC:\Users\Cesar\Downloads\raylib-2.0.0-Win64-mingw\lib -lraylib

Any tips on how can I fix that? Thank you!


  • Hi Hyperbolic!

    You need to link with Windows OS required libraries: -lopengl32 -lgdi32 -std=c99
  • Yay!! Thank you very much!! 😀
Sign In or Register to comment.