I am new to c and trying to run one of the raylib examples. But when compiling it gives me the these errors:
Undefined symbols for architecture x86_64:
"_BeginDrawing", referenced from:
_main in Basic_window-642f03.o
"_ClearBackground", referenced from:
_main in Basic_window-642f03.o
"_CloseWindow", referenced from:
_main in Basic_window-642f03.o
"_DrawText", referenced from:
_main in Basic_window-642f03.o
"_EndDrawing", referenced from:
_main in Basic_window-642f03.o
"_InitWindow", referenced from:
_main in Basic_window-642f03.o
"_WindowShouldClose", referenced from:
_main in Basic_window-642f03.o
ld: symbol(s) not found for architecture x86_64
This is the code used in the example (I named it Basic_window.c):
#include "raylib.h"
int main(void)
{
InitWindow(800, 450, "raylib [core] example - basic window");
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
}
CloseWindow();
return 0;
}
I have copied raylib.h into my the same directory as my Basic_window.c file. I'm using macos 12.3 operating system and using clang as my compiler.