adplug / adplay-unix

AdPlug's UNIX console-based frontend
GNU General Public License v2.0
12 stars 15 forks source link

Issue compiling on OS X Sierra #6

Closed jduraes closed 6 months ago

jduraes commented 7 years ago

Hi there,

I'm having an issue compiling it on my Mac.

make Making all in src /Applications/Xcode.app/Contents/Developer/usr/bin/make all-am g++ -DHAVE_CONFIG_H -I. -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DADPLUG_DATA_DIR=\"/usr/local/com/adplug\" -I/usr/local/include -g -O2 -MT adplay.o -MD -MP -MF .deps/adplay.Tpo -c -o adplay.o adplay.cc adplay.cc:196:14: error: use of undeclared identifier 'no_argument' {"8bit", no_argument, NULL, '8'}, // 8-bit replay ^ adplay.cc:197:15: error: use of undeclared identifier 'no_argument' {"16bit", no_argument, NULL, '1'}, // 16-bit replay ^ adplay.cc:198:14: error: use of undeclared identifier 'required_argument' {"freq", required_argument, NULL, 'f'}, // set frequency ^

Repeated dozens of times.

Any idea on how to overcome these?

Cheers

binarymaster commented 7 years ago

Hello.

Try modifying these lines to include getopt: https://github.com/adplug/adplay-unix/blob/a8d8bc99bc8097aa085a6dad3d46b645d2fa3542/src/adplay.cc#L36

ericinmke commented 6 years ago

This worked for me. I commented out everything related to OS check and just made sure to #include "getopt.h"

I had a separate problem where the compiler had several typecasting errors in "sdl.h". I assume this happened because OS X isn't real picky about filename case, and the compiler was getting the sdl.h in this package confused with the main SDL.h from the SDL package. I fixed this by renaming adplug's "sdl.h" to something else entirely, and updating references to reflect it. There are two of them: line 58 of players.h, and line 22 of sdl.cc.

mywave82 commented 7 months ago

I believe this can be closed.

It can be reopened if any users experiences this or similar on Apple again.

mistydemeo commented 6 months ago

This was fixed by #29; should be fine to close now.