marcel303 / keen

Keen Dreams port using SDL
GNU General Public License v2.0
28 stars 2 forks source link

build process fails while trying to compile opl, on Linux Mint 18. (captilization issues) #3

Closed fragmental closed 6 years ago

fragmental commented 6 years ago

Here is the error I was receiving

gcc -I/usr/local/include -DNO_SDL_GLEXT -g -c opl/opl.c -o opl/opl.o
In file included from opl/opl.h:27:0,
                 from opl/opl.c:31:
opl/../id_heads.h:24:19: fatal error: ERRNO.H: No such file or directory
 #include <ERRNO.H>
                   ^
compilation terminated.
Makefile:77: recipe for target 'opl/opl.o' failed
make: *** [opl/opl.o] Error 1

I have confirmed that this error is caused by "ERRNO.H" being capitalized in the code, and lower case in the directory. There are many other includes with the wrong case in id_heads.h, and some in gelib.c and possibly other places also.

fragmental commented 6 years ago

I started systematically changing the upper case to lower case, and then I realized that I could probably save some time by just making some symlinks.

Then this happened:

gcc -I/usr/local/include -DNO_SDL_GLEXT -g -c syscode.c -o syscode.o
syscode.c:118:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘TimeThread’
 static int __cdecl TimeThread(void * userData)
                    ^
syscode.c: In function ‘SYS_Init’:
syscode.c:374:39: error: ‘TimeThread’ undeclared (first use in this function)
  if ((s_timeThread = SDL_CreateThread(TimeThread, 0)) == 0)
                                       ^
syscode.c:374:39: note: each undeclared identifier is reported only once for each function it appears in
Makefile:77: recipe for target 'syscode.o' failed
make: *** [syscode.o] Error 1
marcel303 commented 6 years ago

Thanks for giving it a try at least. :-) I've set up a virtual machine with Ubuntu 16.04 so I could try compiling it myself (now we got CMake support and all. :-). I've fixed the header file capitalization issues with https://github.com/marcel303/keen/commit/6c73c46c44c8ed000364b3de12eb208c3cda23d0 and the other issue with https://github.com/marcel303/keen/commit/b6753c574456d3729592bb31f2090cdddf9906d7. It should now compile on Linux (or Ubuntu at least). Since Mint is a derivative of Ubuntu I expect it to work too. It's currently quite picky about the version of the game you need in order to run it. I managed to run it with the game files I'm hosting here, http://centuryofthecat.nl/temp/game.zip!

fragmental commented 6 years ago

This is what I get when I run make now

kd_main.c:30:72: fatal error: SDL.h: No such file or directory
 #include <SDL.h> // crashes on Mac if we don't include this file here..
                                                                        ^
compilation terminated.
Makefile:77: recipe for target 'kd_main.o' failed
make: *** [kd_main.o] Error 1

which is weird considering that I have sdl installed.

~/keen dreams/keen-master $ whereis SDL.h
SDL: /usr/include/SDL

I think changing all instances of to <SDL/SDL.h> would probably solve this, but I only tested it on one instance. Then I decided to try cmake. I ran cmake ./ followed by make and it seems to have worked great. I tried the executable that was made and it also seems to work well.

I was able to load the game using the files that you provided.

marcel303 commented 6 years ago

This is to be expected. I intend to remove the Makefile in favor of CMake once it's verified to work correctly (which it does!).

Long version: I had to change the #include statements, since in the CMake script I use a built-in CMake feature to find libsdl and add its includes folder to the search path. Which required me to use instead of <SDL/SDL.h>.