SolvedolcPixelGameEngine Wiki-Entry "Compiling on Linux"

It took me some time to figure out how to compile the olcPGE example on Linux.
The following code may be a good start for the corresponding wiki page:

The following dependencies must be installed including the development files using your packet manager:

  • glew: Modern OpenGL interface.
  • libpng: Portable Network Graphics library to load .png-files.
  • X11: Basic graphics interface for Linux to create a windows.
#!/usr/bin/env bash
LIBS="$(pkg-config --libs glew) $(pkg-config --libs libpng) $(pkg-config --libs x11) -lpthread"
g++ -std=c++17 -o ./olcPGE $LIBS ./olcExampleProgram.cpp
20 Answers

✔️Accepted Answer

Hey that's great! Im working through the documentation, trying to bring it up to scratch. I'll certainly add this in! I'll keep this open for now for others to see.

Other Answers:

Ok ok. I found the issue.

I was indeed compiling out of order. And it wasn't until I was watching another video that he skimmed over the header top and I saw the correct order.

g++-8 olcExampleProgram.cpp -o ExampleProgram -lX11 -lGL -lpthread -lpng -lstdc++fs -std=c++17

you need to use g++8 or higher. for the filesystem library to be found.

Related Issues:

olcPixelGameEngine Wiki-Entry "Compiling on Linux"
Hey that's great! Im working through the documentation trying to bring it up to scratch ...