Compile Supermodel with gcc on windows 10

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
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!

Compile Supermodel with gcc on windows 10

Postby solitarius576 » Sun Nov 13, 2016 2:04 am

I get this error, which looks the same with this one https://launchpadlibrarian.net/29308880 ... ING.txt.gz

g++ Src/Pkgs/tinyxml2.cpp -I/msys64/mingw64/include/SDL -ISrc/ -ISrc/OSD/ -ISrc/OSD/SDL/ -ISrc/OSD/Windows/ -c -Wall -DSUPERMODEL_WIN32 -DGLEW_STATIC -O3 -I/msys64/mingw64/include/boost -std=c++11 -o obj64/tinyxml2.o
g++ -o bin64\Supermodel.exe obj64/Format.o obj64/NewConfig.o obj64/PPCDisasm.o obj64/Games.o obj64/Config.o obj64/INIFile.o obj64/BlockFile.o obj64/93C46.o obj64/ROMLoad.o obj64/unzip.o obj64/ioapi.o obj64/Error.o obj64/glew.o obj64/Shader.o obj64/Real3D.o obj64/Legacy3D.o obj64/Models.o obj64/TextureRefs.o obj64/New3D.o obj64/Mat4.o obj64/Model.o obj64/PolyHeader.o obj64/Texture.o obj64/TextureSheet.o obj64/VBO.o obj64/Vec.o obj64/R3DShader.o obj64/R3DFloat.o obj64/Render2D.o obj64/TileGen.o obj64/Model3.o obj64/ppc.o obj64/Main.o obj64/Audio.o obj64/Thread.o obj64/SoundBoard.o obj64/SCSP.o obj64/SCSPDSP.o obj64/68K.o obj64/m68kcpu.o obj64/m68kopnz.o obj64/m68kopdm.o obj64/m68kopac.o obj64/m68kops.o obj64/DSB.o obj64/Z80.o obj64/IRQ.o obj64/53C810.o obj64/PCI.o obj64/RTC72421.o obj64/DriveBoard.o obj64/MPC10x.o obj64/Input.o obj64/Inputs.o obj64/InputSource.o obj64/InputSystem.o obj64/InputTypes.o obj64/MultiInputSource.o obj64/SDLInputSystem.o obj64/DirectInputSystem.o obj64/Outputs.o obj64/WinOutputs.o obj64/amp_audio.o obj64/amp_dump.o obj64/amp_getbits.o obj64/amp_getdata.o obj64/amp_huffman.o obj64/amp_layer2.o obj64/amp_layer3.o obj64/amp_misc2.o obj64/amp_position.o obj64/amp_transform.o obj64/amp_util.o obj64/Crypto.o obj64/Logger.o obj64/tinyxml2.o -L/msys64/mingw64/lib -lmingw32 -lSDLmain -lSDL -lopengl32 -lglu32 -ldinput8 -ldxguid -lole32 -loleaut32 -lwbemuuid -lz -s
obj64/New3D.o:New3D.cpp:(.text+0x1a1): undefined reference to `New3D::R3DScrollFog::~R3DScrollFog()'
obj64/New3D.o:New3D.cpp:(.text+0x4b7): undefined reference to `New3D::R3DScrollFog::DrawScrollFog(float, float, float, float)'
obj64/New3D.o:New3D.cpp:(.text+0x20f1): undefined reference to `New3D::R3DScrollFog::R3DScrollFog()'
obj64/New3D.o:New3D.cpp:(.text+0x53ea): undefined reference to `New3D::R3DScrollFog::DrawScrollFog(float, float, float, float)'
collect2.exe: error: ld returned 1 exit status
makefile:154: recipe for target 'all' failed
make: *** [all] Error 1

[MINGW64] c:\msys64\mingw64\src\trunk>

So any ideas?
solitarius576
 
Posts: 27
Joined: Thu Oct 20, 2016 10:33 pm

Re: Compile Supermodel with gcc on windows 10

Postby Ian » Sun Nov 13, 2016 2:54 am

The compiler says what the error is.
Simply add r3dscrollfog.cpp to your make file and it will build
Ian
 
Posts: 1175
Joined: Tue Feb 23, 2016 9:23 am

Re: Compile Supermodel with gcc on windows 10

Postby Kacperas » Sun Nov 13, 2016 2:58 am

Your makefile wasn't updated after changes, which Ian has introduced. Please find the line:
Code: Select all
$(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)/R3DFloat.o \


And add $(OBJ_DIR)/R3DScrollFog.o at the end of line, before \.
Code: Select all
$(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)/R3DFloat.o $(OBJ_DIR)/R3DScrollFog.o  \
Kacperas
 
Posts: 39
Joined: Tue Sep 27, 2011 9:35 am

Re: Compile Supermodel with gcc on windows 10

Postby solitarius576 » Sun Nov 13, 2016 5:22 am

Thx both of you, it's working now.
But I have a question, which is the official way to compile Supermodel? On windows you can compile only with vs2013 without errors, vs 2015 will not compile same with 2008 despite the project file sitting in VS2008 directory, with gcc the supplied makefile is old, you have to modify it, plus this new addon. On Linux is the same as seen in that ppa page.
solitarius576
 
Posts: 27
Joined: Thu Oct 20, 2016 10:33 pm

Re: Compile Supermodel with gcc on windows 10

Postby Ian » Sun Nov 13, 2016 5:34 am

I only have vs 2013
What errors does it spit out with vs2015?

If you paste them here I can probably fix them
Ian
 
Posts: 1175
Joined: Tue Feb 23, 2016 9:23 am

Re: Compile Supermodel with gcc on windows 10

Postby solitarius576 » Sun Nov 13, 2016 5:47 am

I get this error when i try to compile the debugger included build
obj64/Musashi68KDebug.o:Musashi68KDebug.cpp:(.text+0x8d): undefined reference to `M68KGetRegister(SM68KCtx*, unsigned int)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x28e): undefined reference to `CZ80::GetReg16(unsigned int)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x2dc): undefined reference to `CZ80::GetReg16(unsigned int)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x398): undefined reference to `CZ80::DetachDebugger()'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x3d8): undefined reference to `CZ80::DetachDebugger()'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x4aa): undefined reference to `CZ80::GetReg8(unsigned int)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x4c1): undefined reference to `CZ80::GetReg8(unsigned int)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x208): undefined reference to `CZ80::GetReg8(unsigned int)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x21c): undefined reference to `CZ80::SetReg8(unsigned int, unsigned char)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x228): undefined reference to `CZ80::GetReg16(unsigned int)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x32c): undefined reference to `CZ80::SetReg16(unsigned int, unsigned short)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x341): undefined reference to `CZ80::SetReg16(unsigned int, unsigned short)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x35b): undefined reference to `CZ80::AttachDebugger(Debugger::CZ80Debug*)'
obj64/Z80Debug.o:Z80Debug.cpp:(.text+0x368): undefined reference to `CZ80::DetachDebugger()'
collect2.exe: error: ld returned 1 exit status
makefile:154: recipe for target 'all' failed
make: *** [all] Error 1

but Z80Debug.cpp is included and the class CZ80 is defined in Z80Debug.h which appears in the makefile, as far I can understand it.

Ian wrote:I only have vs 2013
What errors does it spit out with vs2015?

If you paste them here I can probably fix them


I don't have VS 2015 anymore, but it was related to the global variable data defined below
extern int append,data,f_bdirty,bclean_bytes; in file Src\Sound\MPEG\getbits.h

I see that Kacperas solved the VS 2015 problem
Kacperas wrote:I was able to build latest SVN using both VS2013 and VS2015. Sadly, in both cases there was a problem with corrupted audio... VS2015 compiler gave me some headache, as it's more sensitive in some cases. Anyway, I had to modify some files:
- main.cpp
- audio.cpp
- layers2.cpp
- huffman.cpp

In case of main.cpp, space was missing in line 1372 between " and SUPERMODEL_VERSION. For the rest of files, 'data' was ambiguous, so either changing it to ::data or adding a namespace allowed compilation to finish.
solitarius576
 
Posts: 27
Joined: Thu Oct 20, 2016 10:33 pm

Re: Compile Supermodel with gcc on windows 10

Postby Ian » Sun Nov 13, 2016 5:58 am

I've never actually compiled with the debugger
I'll see what it does

Okay I built it with vs2013 .. and it works fine
Ian
 
Posts: 1175
Joined: Tue Feb 23, 2016 9:23 am

Re: Compile Supermodel with gcc on windows 10

Postby solitarius576 » Sun Nov 13, 2016 6:13 am

VS 2013 is compiling just fine, that build too, I mean the one with the debugger included, so you will probably not have errors on your part.
I will try to look around on unix sites to figure it out, or maybe Kacperas will have a solution.

It works now, I just had to do a make clean, before building again the debugger version after a non-debugger build.
solitarius576
 
Posts: 27
Joined: Thu Oct 20, 2016 10:33 pm

Re: Compile Supermodel with gcc on windows 10

Postby Bart » Sun Nov 13, 2016 1:51 pm

Sorry about the build mess, guys. When I started this project, I had zero real software engineering skills (I still don't! :D ). I use gcc on Windows for this project because I prefer it as a compiler (I think it tends to generate better code than MSVC and is more likely to be standards-compliant) and it makes life easier on other platforms. The Makefiles I put together are total garbage, though, because they don't properly track dependencies. In the future, for my gcc-based projects, I intend to write a Python-based build script similar to something we have at work, which magically analyzes dependencies on the fly and builds everything. No Makefiles or config scripts required; perfect dependency tracking. Once you see one of these build environments in action, you'll never be able to go back :)
User avatar
Bart
Site Admin
 
Posts: 2038
Joined: Thu Sep 01, 2011 2:13 pm
Location: New York City

Re: Compile Supermodel with gcc on windows 10

Postby solitarius576 » Mon Nov 14, 2016 1:08 am

I don't need help, just wanted to share:)
This is bizarre, my compiled versions with gcc are not working. Just to be sure I installed VS 2013 and builds made with it, are not working either. They compile fine without any errors and yet they are not working. For another test I compiled reicast(dreamcast emulator) with VS 2013 and that is working. So I guess compiling projects is not for me, better leave them to the devs.

Edit:
Oh, wow, how stupid one can be, forgot to copy SDL.dll over :)
solitarius576
 
Posts: 27
Joined: Thu Oct 20, 2016 10:33 pm

Next

Return to The Dark Room

Who is online

Users browsing this forum: sonic32 and 1 guest