Closed jonjondev closed 3 years ago
Here's the build lib file too: libraylib.zip
I managed to get this working on Windows
. Looks like there are a few pitfalls that need to be looked out for:
g++ -std=c++17 -I ./include/ -L./lib ./src/main.cpp -o ./build/app -lraylib
2) There are a few system libraries that need to be included as well. In my case they were: -pthread -lopengl32 -lgdi32 -lwinmm -mwindows
, however I'm not sure what the equivalent is for Linux. Based off this issue, it looks like the creator specifies -lglfw3 -lGL -lopenal -lm -pthread -ldl
as dependencies for Ubuntu. I'm 100% sure if this would work, but you might be able to do this by switching the command to:
g++ -std=c++17 -I ./include/ -L ./lib/Linux ./src/main.cpp -o $(buildfile) -lraylib -lglfw3 -lGL -lopenal -lm -pthread -ld
That's my current guess.
Also, the source for my windows libraries: http://bedroomcoders.co.uk/creating-a-64-bit-executable-with-raylib-on-windows/.
- In g++, the ordering of your libraries matter. Based off this SO thread, it looks like we need to move the library definitions to the end of the command.
Absolutely 100% on the money with that catch my dude. However I did a little search of raylibs docs for Linux and found this command, which included some library options. Plugged them into the Makefile and the whole thing just compiled on make
no problem.
The working options:
-l GL -l m -l pthread -l dl -l rt -l X11
Now please enjoy this image of the project running correctly in Ubuntu.
Updated the Makefile Linux options and docs info in this commit. Issue is now fixed, thanks @Raelr!
I get the following issue when building with g++:
pls fix, terrible devs