libretro / Craft

A simple Minecraft clone written in C using modern OpenGL (shaders).
http://www.michaelfogleman.com/craft/
MIT License
45 stars 19 forks source link

Fix compilation errors. #36

Open TamaMcGlinn opened 3 years ago

TamaMcGlinn commented 3 years ago

I thought it might be nice if the project could compile. The fixes on this branch are pretty obvious; don't point at files and directories that don't exist, don't assume stderr is available without including stdio.h, don't include a Makefile that gets overwritten by the build process.

After that, I'm still stuck with an error:

[  5%] Linking C executable craft
/usr/bin/ld: CMakeFiles/craft.dir/src/renderer.c.o: undefined reference to symbol 'glLogicOp'
/usr/bin/ld: //usr/lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/craft.dir/build.make:310: craft] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/craft.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

I'm guessing the order of the -l flags is incorrect, but I'm not sure where to look for those at the moment.

inactive123 commented 3 years ago

Hi, while i appreciate the work and labor that went into this, there might be a misunderstanding as to how Libretro cores get built.

For most cores, we built it for each platform with a static Makefile. We only use cmake for cores where it is absolutely necessary because we are locked-in by an upstream because of it. For other cores where it's possible, we always try to make do with a static Makefile instead.

Also, for libretro cores we typically shy away from adding system level dependencies, so stuff like glfw would typically not be built in, or at least heavily edited so that there are no real runtime or compile-time dependencies.

TamaMcGlinn commented 3 years ago

The readme says to do 'cmake .' followed by 'make'. From your reaction I understand you will want most of the commits in this PR, but instead of removing the Makefile you will want to remove the CMakeLists and edit the readme to tell people to build some other way.