OSX 10.10 (Yosemite) Bug

Linux geeks and Mac OS hipsters unite! A board for discussion of Supermodel on non-Windows platforms.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Re: OSX 10.10 (Yosemite) Bug

Postby 2DForever » Tue Apr 12, 2016 9:53 am

I popped that one in on line 68, so it now reads:
Code: Select all
COMPILER_FLAGS = -I$(OBJ_DIR) -ISrc/ -ISrc/OSD -ISrc/OSD/SDL/ -ISrc/Pkgs/ -ISrc/CPU/68K/Musashi -ISrc/Sound/MPEG  -c -Wall -O3 -DUSE_FILE32API -DSUPERMODEL_OSX -std=c++11 -F/Library/Frameworks/


And that throws up the error:
Code: Select all
error: invalid argument '-std=c++11' not allowed with 'C/ObjC'
make: *** [obj/unzip.o] Error 1


My lack of knowledge about any of this and a quick google didn't help! Anyway, one to put on the low priority list unless I'm doing something stupid.
2DForever
 
Posts: 27
Joined: Mon Feb 17, 2014 4:46 am

Re: OSX 10.10 (Yosemite) Bug

Postby Bart » Tue Apr 12, 2016 10:03 am

This flag should only be applied to .cpp (C++) files. So make sure to add it to CPPFLAGS and try again. unzip.c is a C file and uses CFLAGS.
User avatar
Bart
Site Admin
 
Posts: 1834
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: OSX 10.10 (Yosemite) Bug

Postby 2DForever » Tue Apr 12, 2016 2:08 pm

Thanks Bart, I'm happy to keep testing things here if you are! A bit slow I know, but I'm happy to help.

Moving that flag to CPPFLAGS seems to helped somewhat, but we have a new error:
Code: Select all
gcc Src/Pkgs/unzip.c -Iobj -ISrc/ -ISrc/OSD -ISrc/OSD/SDL/ -ISrc/Pkgs/ -ISrc/CPU/68K/Musashi -ISrc/Sound/MPEG  -c -Wall -O3 -DUSE_FILE32API -DSUPERMODEL_OSX -F/Library/Frameworks/ -o obj/unzip.o
Src/Pkgs/unzip.c:1699:46: warning: equality comparison with extraneous
      parentheses [-Wparentheses-equality]
    if ((pfile_in_zip_read_info->read_buffer == NULL))
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Src/Pkgs/unzip.c:1699:46: note: remove extraneous parentheses around the
      comparison to silence this warning
    if ((pfile_in_zip_read_info->read_buffer == NULL))
        ~                                    ^      ~
Src/Pkgs/unzip.c:1699:46: note: use '=' to turn this equality comparison into an
      assignment
    if ((pfile_in_zip_read_info->read_buffer == NULL))
                                             ^~
                                             =
1 warning generated.
gcc Src/Pkgs/ioapi.c -Iobj -ISrc/ -ISrc/OSD -ISrc/OSD/SDL/ -ISrc/Pkgs/ -ISrc/CPU/68K/Musashi -ISrc/Sound/MPEG  -c -Wall -O3 -DUSE_FILE32API -DSUPERMODEL_OSX -F/Library/Frameworks/ -o obj/ioapi.o
make: *** No rule to make target `obj/Error.o', needed by `all'.  Stop.


Any suggestions welcome and I'll keep trying :)
2DForever
 
Posts: 27
Joined: Mon Feb 17, 2014 4:46 am

Re: OSX 10.10 (Yosemite) Bug

Postby Bart » Tue Apr 12, 2016 10:10 pm

You are almost there!

Files have been added and renamed since v0.2a. Take a look at the UNIX Makefile and copy over the big list of object files (it's called OBJ and spans multiple lines. Delete the ones in the Mac Makefile entirely and paste the Linux ones.

Then, make sure this one is present (you can stick it on the last line):

$(OBJ_DIR)/SDLMain_tmpl.o

I'm not completely clear on the Mac build process but this is apparently required on Mac and does not appear in the other Makefiles.
User avatar
Bart
Site Admin
 
Posts: 1834
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: OSX 10.10 (Yosemite) Bug

Postby 2DForever » Wed Apr 13, 2016 1:05 am

Thanks again for the help Bart, hopefully getting closer!

First of all I got an error on line 108, which is the last line on the Objects and Dependencies list below. The error reads:
Code: Select all
makefile:108: *** commands commence before first target.  Stop.


So I added in the backslash on the second to last line as it seemed to be some kind of list that would require it. Then trying again I got a different error:

Code: Select all
make: *** No rule to make target `obj/Error.o', needed by `all'.  Stop.

From what I can tell the Error.o line is exactly the same as the old OSX make code, so I'm unsure why it's having issues there.

To get to this point I removed the old Mac Objects and Dependencies and replaced it with the following Unix code plus the SDL line at the end:
Code: Select all
#
# Objects and Dependencies
#
HEADERS = Src/Supermodel.h Src/Games.h Src/OSD/SDL/Types.h
OBJ = $(OBJ_DIR)/PPCDisasm.o $(OBJ_DIR)/Games.o $(OBJ_DIR)/Config.o $(OBJ_DIR)/INIFile.o $(OBJ_DIR)/BlockFile.o $(OBJ_DIR)/93C46.o \
   $(OBJ_DIR)/ROMLoad.o $(OBJ_DIR)/unzip.o $(OBJ_DIR)/ioapi.o $(OBJ_DIR)/Error.o $(OBJ_DIR)/glew.o $(OBJ_DIR)/Shader.o \
   $(OBJ_DIR)/Real3D.o $(OBJ_DIR)/Legacy3D.o $(OBJ_DIR)/Models.o $(OBJ_DIR)/TextureRefs.o \
   $(OBJ_DIR)/New3D.o $(OBJ_DIR)/Mat4.o $(OBJ_DIR)/Model.o $(OBJ_DIR)/PolyHeader.o $(OBJ_DIR)/Texture.o $(OBJ_DIR)/TextureSheet.o $(OBJ_DIR)/VBO.o $(OBJ_DIR)/Vec.o $(OBJ_DIR)/R3DShader.o \
   $(OBJ_DIR)/Render2D.o $(OBJ_DIR)/TileGen.o \
   $(OBJ_DIR)/Model3.o $(OBJ_DIR)/ppc.o $(OBJ_DIR)/Main.o $(OBJ_DIR)/Audio.o $(OBJ_DIR)/Thread.o $(OBJ_DIR)/SoundBoard.o \
   $(OBJ_DIR)/SCSP.o $(OBJ_DIR)/SCSPDSP.o $(OBJ_DIR)/68K.o $(OBJ_DIR)/m68kcpu.o $(OBJ_DIR)/m68kopnz.o $(OBJ_DIR)/m68kopdm.o \
   $(OBJ_DIR)/m68kopac.o $(OBJ_DIR)/m68kops.o $(OBJ_DIR)/DSB.o $(OBJ_DIR)/Z80.o \
   $(OBJ_DIR)/IRQ.o $(OBJ_DIR)/53C810.o $(OBJ_DIR)/PCI.o $(OBJ_DIR)/RTC72421.o $(OBJ_DIR)/DriveBoard.o \
   $(OBJ_DIR)/MPC10x.o $(OBJ_DIR)/Input.o $(OBJ_DIR)/Inputs.o $(OBJ_DIR)/InputSource.o $(OBJ_DIR)/InputSystem.o \
   $(OBJ_DIR)/InputTypes.o $(OBJ_DIR)/MultiInputSource.o $(OBJ_DIR)/SDLInputSystem.o \
   $(OBJ_DIR)/Outputs.o \
   $(OBJ_DIR)/amp_audio.o $(OBJ_DIR)/amp_dump.o $(OBJ_DIR)/amp_getbits.o $(OBJ_DIR)/amp_getdata.o $(OBJ_DIR)/amp_huffman.o \
   $(OBJ_DIR)/amp_layer2.o $(OBJ_DIR)/amp_layer3.o $(OBJ_DIR)/amp_misc2.o $(OBJ_DIR)/amp_position.o $(OBJ_DIR)/amp_transform.o \
   $(OBJ_DIR)/amp_util.o \
   $(OBJ_DIR)/Crypto.o \
   $(OBJ_DIR)/Format.o \
   $(OBJ_DIR)/SDLMain_tmpl.o


And was mentioned above I added the backslash at the end of the Format.o line at the end.
2DForever
 
Posts: 27
Joined: Mon Feb 17, 2014 4:46 am

Re: OSX 10.10 (Yosemite) Bug

Postby Bart » Wed Apr 13, 2016 9:01 am

Make sure the rules involving Src/Graphics match the ones in the UNIX Makefile. Files were moved around. You will also have to add the rule for Src/Util. Almost there!
User avatar
Bart
Site Admin
 
Posts: 1834
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: OSX 10.10 (Yosemite) Bug

Postby 2DForever » Wed Apr 13, 2016 10:42 am

Thanks for your patience Bart! Good news, it started to build, bad news, it didn't quite finish.

First of all, it had trouble building throwing up this error:
Code: Select all
Src/OSD/SDL/Main.cpp:1371:61: error: invalid suffix on literal; C++11 requires a
      space between literal and identifier [-Wreserved-user-defined-literal]
        puts("Supermodel: A Sega Model 3 Arcade Emulator (Version "SUPERMODEL_VE...
                                                                   ^


To see if I could easily get around it, I removed the (Version "SUPERMODEL_VERSION") from line 1371 and tried again. It seemed to build further, but this time giving a different error of:
Code: Select all
1 warning generated.
c++ Src/Util/Format.cpp -Iobj -ISrc/ -ISrc/OSD -ISrc/OSD/SDL/ -ISrc/Pkgs/ -ISrc/CPU/68K/Musashi -ISrc/Sound/MPEG  -c -Wall -O3 -DUSE_FILE32API -DSUPERMODEL_OSX -F/Library/Frameworks/ -std=c++11 -o obj/Format.o
make: *** No rule to make target `obj/SDLMain_tmpl.o', needed by `all'.  Stop.

The obj/SDLMain_tmpl.o was a bit we added to the makefile, right? Wondering if that's slightly wrong in some way? In the makefile it's referenced as:
Code: Select all
$(OBJ_DIR)/amp_util.o $(OBJ_DIR)/SDLMain_tmpl.o

Which was taken from the original OSX makefile. Removing the first "$(OBJ_DIR)/amp_util.o" bit comes up with the same error.
2DForever
 
Posts: 27
Joined: Mon Feb 17, 2014 4:46 am

Re: OSX 10.10 (Yosemite) Bug

Postby Bart » Wed Apr 13, 2016 3:20 pm

I'll fix the problem in Main.cpp. Basically just add spaces around SUPERMODEL_VERSION:

Code: Select all
puts("foo"SUPERMODEL_VERSION"var"); -> change to -> puts("foo" SUPERMODEL_VERSION "bar");


As for your last error, you must have cut out this Mac-specific rule:

Code: Select all
$(OBJ_DIR)/%.o: Src/OSD/SDL/%.m $(HEADERS)
        $(OCC) -x objective-c++ $< $(CPPFLAGS) -o $(OBJ_DIR)/$(*F).o
User avatar
Bart
Site Admin
 
Posts: 1834
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: OSX 10.10 (Yosemite) Bug

Postby 2DForever » Thu Apr 14, 2016 3:48 pm

Thanks again Bart for your helpful persistence :)
Your last addition helped it along a bit further (so it's now taking quite a while to build until an error, which must be good!) but it's throwing up the following error:
Code: Select all
gcc -o bin/Supermodel -framework SDL -framework AGL -framework OpenGL -framework GLUT -framework Cocoa -lz -lm -lstdc++ -F/Library/Frameworks/  obj/PPCDisasm.o obj/Games.o obj/Config.o obj/INIFile.o obj/BlockFile.o obj/93C46.o obj/ROMLoad.o obj/unzip.o obj/ioapi.o obj/Error.o obj/glew.o obj/Shader.o obj/Real3D.o obj/Legacy3D.o obj/Models.o obj/TextureRefs.o obj/New3D.o obj/Mat4.o obj/Model.o obj/PolyHeader.o obj/Texture.o obj/TextureSheet.o obj/VBO.o obj/Vec.o obj/R3DShader.o obj/Render2D.o obj/TileGen.o obj/Model3.o obj/ppc.o obj/Main.o obj/Audio.o obj/Thread.o obj/SoundBoard.o obj/SCSP.o obj/SCSPDSP.o obj/68K.o obj/m68kcpu.o obj/m68kopnz.o obj/m68kopdm.o obj/m68kopac.o obj/m68kops.o obj/DSB.o obj/Z80.o obj/IRQ.o obj/53C810.o obj/PCI.o obj/RTC72421.o obj/DriveBoard.o obj/MPC10x.o obj/Input.o obj/Inputs.o obj/InputSource.o obj/InputSystem.o obj/InputTypes.o obj/MultiInputSource.o obj/SDLInputSystem.o obj/Outputs.o obj/amp_audio.o obj/amp_dump.o obj/amp_getbits.o obj/amp_getdata.o obj/amp_huffman.o obj/amp_layer2.o obj/amp_layer3.o obj/amp_misc2.o obj/amp_position.o obj/amp_transform.o obj/amp_util.o obj/Crypto.o obj/Format.o obj/amp_util.o obj/SDLMain_tmpl.o
duplicate symbol __Z4warnPcz in:
    obj/amp_util.o
duplicate symbol __Z3msgPcz in:
    obj/amp_util.o
duplicate symbol __Z3diePcz in:
    obj/amp_util.o
duplicate symbol __Z12debugOptionsv in:
    obj/amp_util.o
duplicate symbol _debugFlags in:
    obj/amp_util.o
duplicate symbol _debugLookup in:
    obj/amp_util.o
duplicate symbol __Z10debugSetupPc in:
    obj/amp_util.o
ld: 7 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [all] Error 1


Sorry for the really long paragraph at the start there, but it might have something to do with the duplication error mentioned. Any ideas? ps: Also feel free to leave it for another day/year if this is getting irritating!
2DForever
 
Posts: 27
Joined: Mon Feb 17, 2014 4:46 am

Re: OSX 10.10 (Yosemite) Bug

Postby Bart » Thu Apr 14, 2016 6:20 pm

No trouble at all. Once you're done, I'd like to have the complete Makefile so I can update it.

Looks like you're linking amp_util.o twice. Remove the second one, following Format.o, from the object list.
User avatar
Bart
Site Admin
 
Posts: 1834
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

PreviousNext

Return to Alternative Fashion

Who is online

Users browsing this forum: Bing [Bot] and 3 guests