I’m having some issues when trying to compile the first lesson with raylib’s InitWindow on a macbook M1 Max, macOS Ventura 13.0.1
/usr/bin/clang++ -fcolor-diagnostics -fansi-escape-codes -g /Users/workmac/Projects/c++/Project/main.cpp -o /Users/workmac/Projects/c++/Project/main
Undefined symbols for architecture arm64:
"_InitWindow", referenced from:
_main in main-b31d98.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build finished with error(s).
I’ve managed to get a bit further by reinstalling Homebrew in the Apple Silicon folders, as previously it was running from folders used on previous Intel machine.
The problem I’m having now is that probably the location in the project setup and the homebrew for M++ chips is not the same anymore and I’m getting the error:
You can add/change the location of Raylib that the template looks for by going into c_cpp_properties.json and modify the “IncludePath” section(s) for MacOS
That file is located in the .vscode folder in the project.
Alright, try adding /opt/homebrew/Cellar/raylib/ to the includepath. I’m wondering if VSCode is having difficulty accessing the path originally specified in our template.
Ok, I’ve removed it from homebrew, and using cLion and cMake got it to work.
For anyone having this issue, just create a new project using cMake and use the cmake config from here: