Trouble Compiling on Mac
danpaquette opened this issue · 6 comments
Hello!
Wondering if you could help me get this working on Mac. I'm not very familiar with C, but I'm getting this error:
make: sdl2-config: Command not found
src/snescity.c:839:4: warning: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Wimplicit-function-declaration]
snprintf(ci ? city2 : city1, 17, "%d. %4d %-8s",ci+1,year,name);
src/snescity.c:839:4: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
1 warning generated.
make: sdl2-config: Command not found
src/pngmap.c:3:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
1 error generated.
make: *** [obj/pngmap.o] Error 1
Is this something you could help me with? Thanks in advance!
While I never used MacOS X, it seems like you don't have the SDL2 library installed. Hence the "sdl2-config" executable not being available.
You can either try installing the library or modifying Makefile.cfg to say "SDL_UI=0”, in which case the program will be compiled without a graphical user interface.
Right-o, that was just an PATH problem; got that resolved.
This seems to be more of the issue though:
src/snescity.c:839:4: warning: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Wimplicit-function-declaration]
snprintf(ci ? city2 : city1, 17, "%d. %4d %-8s",ci+1,year,name);
src/snescity.c:839:4: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
1 warning generated.
src/pngmap.c:3:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
1 error generated.
make: *** [obj/pngmap.o] Error 1
Clearly both #include <stdio.h> and #include <malloc.h> appear in the correct locations.
I ended up solving this by placing the SDL files and malloc.h in my /usr/includes folder. Not sure if that's the right way to solve this issue or not, but it did compile, albeit with warnings that I set to ignore.
The interface looks like this on Mac: http://imgur.com/a/yilWR
But everything is mostly functional. Unfortunately, the drag and drop doesn't work.
Here's the warnings I get from the compiler: http://imgur.com/a/a79KF
Hope this helps!
Seems like the fonts don't have a transparent bug because of a bug in libSDL-image 2.0. Please update to version 2.0.1, where this issue is fixed.
As for drag-and-drop, seems like it's limited on OS X, and using it requires editing the "info.plist" file, about which I have absolutely no idea.
Looks like I completely forgot about this last issue. I have never used Mac OS and, sadly, have no way of trying to fix that last part :-(