I'm trying to make a game with raylib.
I included the library
#include "raylib.h"
and included its include and lib files in g++
g++ -o ./bin/execute -I ./include -L ./lib ./main.cpp
but when i start using the raylib library, using an official example i get these errors at compilation:
/usr/bin/ld: /tmp/ccFEN46h.o: in function `main':
main.cpp:(.text+0x37): undefined reference to `InitWindow'
/usr/bin/ld: main.cpp:(.text+0x41): undefined reference to `SetTargetFPS'
/usr/bin/ld: main.cpp:(.text+0x48): undefined reference to `BeginDrawing'
/usr/bin/ld: main.cpp:(.text+0x70): undefined reference to `ClearBackground'
/usr/bin/ld: main.cpp:(.text+0xb1): undefined reference to `DrawText'
/usr/bin/ld: main.cpp:(.text+0xb6): undefined reference to `EndDrawing'
/usr/bin/ld: main.cpp:(.text+0xbb): undefined reference to `WindowShouldClose'
/usr/bin/ld: main.cpp:(.text+0xc7): undefined reference to `CloseWindow'
collect2: error: ld returned 1 exit status
How can I use the raylib library?
(my code):
#include "raylib.h"
int main(int argc, char const *argv[])
{
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "i like men");
SetTargetFPS(60);
while (!WindowShouldClose()) {
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Window moment (i like men btw)", 190, 200, 20, LIGHTGRAY);
EndDrawing();
}
CloseWindow();
return 0;
}