[SOLVED] QuakeSpasm compile problem

Discuss programming topics for the various GPL'd game engine sources.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: QuakeSpasm compile problem

Post by revelator »

your welcome :) didnt take me long atleast just had to add ddraw and dxguid to libraries and the static SDL build worked right out of the box.
Used my own builds of vorbis/ogg as the ones supplied with the source where dll versions only.

The MinGW64 build seems to not use opus at all so i got around that one pretty easy hehe.
Productivity is a state of mind.
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: QuakeSpasm compile problem

Post by toneddu2000 »

Hi reckless I downloaded the file but there is only the binary, I would need the src.
Would you please post the src if you don't mind? Because I use QuakeSpam to learn quake architecture

Thanks again
Meadow Fun!! - my first commercial game, made with FTEQW game engine
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: QuakeSpasm compile problem

Post by revelator »

Sure :) but i only changed the codeblocks version to use static libraries.
Also there seems to be a problem with MinGW32 when using static libraries with SDL, bitches about missing winmm exports.
64 bit build works though hmm.

http://code.google.com/p/realm/download ... z&can=2&q=

libraries in mingw use libname.dll.a for dynamic versions while libname.a can be both.
msvc has no such destinction so unless you name the library yourself it can be pretty hard to tell if its either.
Productivity is a state of mind.
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: QuakeSpasm compile problem

Post by toneddu2000 »

thanks a lot reckless! Just last question, since I'm a completely noob in programming could you please explain in just two words (or, if you have a good link to share) the steps I had to complete to compile at 64 bit an engine that was designed for 32 bits? Because, if I had understood well I don't have only to change link in header files to 64bit libs, but I need to change type to variables. Is that correct

Thanks again, you're helping me understand a lot! :)
Meadow Fun!! - my first commercial game, made with FTEQW game engine
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: QuakeSpasm compile problem

Post by revelator »

Woa not so fast :) if the source is allready ported for 64 bit programming you dont need all that.

Now it depends a bit on the compiler you use how to get a 64 bit build, in msvc with your project open click the build tab and select configuration manager.
Now set the active solution platform to x64 and hit close. You can now build a 64 bit version.

Codeblocks is a bit different especially since the default version from them has no option to set a build for x64, so with your project open in codeblocks rightclick quakespasm in the workspace view and select build options, now set the selected compiler to MinGW64 insted of MinGW and hit ok. You can now build it as 64 bit.

Small warning here, im one of the few that supplies codeblocks with both the 32 and 64 bit MinGW compilers so if you intend to use codeblocks it might be a good idea starting with that, else it would take the rest of
the screenspace on this forum teaching you how to set it up for MinGW64 ;).

This is about as short as i can make it but i hope it helps.

But yes if you intend to build a 64 bit executable that needs 3'rd party libraries you have to make sure those libraries are 64 bit and link to them.
As for the other stuff well int's have different sizes on 64 bit but you can get a long way with changing those to intptr_t (supplies the correct value in either mode) instead of plain int, or uintptr_t for unsigned ints.
beware that other types might also have to be changed and the compiler might not have easy types like the above for those.
Probably better to put of 64 bit porting untill you learned what the differnt types do :) it will come as you play with it enough.
Productivity is a state of mind.
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: QuakeSpasm compile problem

Post by toneddu2000 »

Ok, now I got it. I understood is a matter of libs and code written in a wise way.I'll follow your hints,thanks a lot!
I found this link for noobs like me on how to compile code for 64bit in MSVS
Unfortunately I can't compile your code with C::B :(.
It yells 56 errors (i think in the linking phase) like "in ..\codecs\x86\libSDL.a (SDL_systimer.o): SDL_systimer.c undefined reference tp '__ms_vsnpritf' " and so on
I always had a idiosyncrasy against C::B but now it's unbelievable! :) The funny thing is on same computer your src on VisualStudio2008 compiles fine!!
Meadow Fun!! - my first commercial game, made with FTEQW game engine
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: QuakeSpasm compile problem

Post by revelator »

Aye C::B with MinGW is tricky :) in most cases it comes down to the libraries being ordered correctly (especially when linking with static ones) i guess you are using MinGW from mingw.org but my libraries are made
with the 32 bit MinGW64 compiler and it uses a different exception system. eg- (MinGW uses dwarf2 while MinGW64 uses sjlj or in case of the 64 bit MinGW64 SEH exceptions) so you cannot mix the libraries from them :S.
Also standard MinGW lacks a lot of the directx sdk. Nowadays i prefer using the MinGW64 compiler ;) it has much better support for directx but also has some other caveats that can be hard for a first time user if hees used to MinGW. The upside is you can build for both architectures (x86, x86_64).

I havent touched the msvc projects yet so they still link to the dll libraries but yeah it works out of the box ;)
Productivity is a state of mind.
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: QuakeSpasm compile problem

Post by toneddu2000 »

reckless, I'm going crazy! Can you please post the link of 32 bit MinGW64 compiler? I downloaded this.
The setup created two folders in my C: folder: win-builds-32 and win-builds-64, I used the first
I chose in C::B, in Settings->Compiler->Toolchain executables
for c compiler: c++.exe
for c++ compiler: i686-w64-mingw32-g++-4.8.2.exe
for linker for dynamic libs: i686-w64-mingw32-g++-4.8.2.exe
for linker for static libs: ar.exe
for Resource compiler: windres.exe
for Make program: ?? can't find anything in that folder that seems to have "make" in its name
Now when it compiles it throws the error(after have compiled all the -o objects):

Code: Select all

gcc: error: CreateProcess: No such file or directory
windres.exe: preprocessing failed.
Process terminated with status 1 (0 minute(s), 42 second(s))
2 error(s), 0 warning(s) (0 minute(s), 42 second(s))
What am i gonna do??! It has become a matter of honour! :)
Please help!
Meadow Fun!! - my first commercial game, made with FTEQW game engine
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: QuakeSpasm compile problem

Post by revelator »

https://sourceforge.net/projects/cbadva ... l/release/

get the 3 files and unzip them using 7zip to C:\ this will create C:\CodeBlocks

go into that folder and start the CodeBlocks.exe (P.S remember to uninstall your other codeblocks first before starting mine) you should get a screen now with detected compilers usually MinGW MinGW32 and MinGW64
and maybe msvc, set the default compiler to MinGW32 and hit ok. It will also ask to set associations to CodeBlocks let it do that.
My build includes all 3 MinGW versions so you can easily switch to another compiler from the build menu :) but for now let it stay on MinGW32.
open quakespasms codeblocks workspace and hit build.
Only downside is the size, my build includes a lot of tools which are very usefull for an experienced programmer but might seem like overkill to a new user, while actually being the opposite cause it makes it a lot easier to work with :).

I had an installer for it in the past but people prefer the zipped versions so the crowd won that argument.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: QuakeSpasm compile problem

Post by revelator »

Ok finally fixed the linker problem with the 32 bit build so i can make static win32 builds also now :)
As suspected it was the infamous library order in effect again :( SDL is very picky indeed.

Ill be updating the msvc versions also so that you can build those statically also.

Ill post source when done.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: QuakeSpasm compile problem

Post by revelator »

http://code.google.com/p/realm/download ... z&can=2&q=

source so far fixed static builds with codeblocks, project setup for both MinGW64 32 bit and 64 bit (needs my codeblocks suite for this unless you want to spend 6 years trying to figure out how to modify C::B's sourcecode to detect and set it up it correctly, so use that :P) a more experienced programmer could probably do it in way less but as you said it became a matter of honour for me to.

Still working on the MSVC projects ill post final source when all is done.

P.S source has both the 32 and 64 bit quakespasm builds in the root to try out.
Productivity is a state of mind.
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: QuakeSpasm compile problem

Post by toneddu2000 »

How can I say? reckless you're a saint!! Thanks a bunch! But my computer has to have idiosincracy with C::B too because tonight I downloaded the 1.8GB C::B solution you posted and my antivirus went crazy when I opened the 7.z finding 11 elevens viruses (Tr.Agent3311116,404477.1,Crypt.XPack.Gen and a bunch of Dldr.AdSechost)and completely lost control so I had to remove files and do a full check restore :). I'll try it out on a different PC and I'll see how it responds(the solution you posted has also binary for Linux?If so it would be no problem). Tonight I'll try out on Linux,thanks a lot for your effort, my honour is safe now! :D
Meadow Fun!! - my first commercial game, made with FTEQW game engine
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: QuakeSpasm compile problem

Post by revelator »

Yep also getting loads of those virus warnings with kaspersky there wrong though and i should know i built the whole damn thing myself and i dont dabble in virusses :)
i usually install my compiler suite on another drive than c:\ and add it to exceptions in my antivirus or it will wreck every build im trying to do.

Most problems with todays antivirus solutions seem to be caused by heuristic analysis that tries to guess if a program poses a threat if the antivirus does not recognize it, and most of them dont since MinGW / Msys
are programs you usually see on a linux system so were screwed bob :P.

P.s no linux binary but since codeblocks is avaliable for most linux distros it should not be to hard to make one :) quakespasm has a codeblocks workspace in the linux dir.
Productivity is a state of mind.
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: QuakeSpasm compile problem

Post by toneddu2000 »

Sorry for my late reply but I passed all the evening to find a solution to use your codeblocks environment without warnings for viruses
Yep also getting loads of those virus warnings with kaspersky there wrong though and i should know i built the whole damn thing myself and i dont dabble in virusses :)
i usually install my compiler suite on another drive than c:\ and add it to exceptions in my antivirus or it will wreck every build im trying to do.
No, no, of course reckless, I ve no doubt about it! It's only that on this computer I've vitals data for my work and I tried to act very carefully
OK, for the ones who had same problem with virus detecting there are two solutions:
1)if your antivirus is not so insistent you could use files as reckelss posted.
2)if you have Avira like me is pratically impossible to use the folder as is(every two second a warning). So I downloaded the files on linux, you can use wine to launch your antivirus from here and search the 12 files that yell warning (some seem important ). I list them below:

Code: Select all

Cccc.exe
Mc.exe
MinTTY.exe
Shell32.exe
Shell64.exe
Opt\Ocaml32\bin\gdk_pixbuf_mlsource
Bin\gpg-error.exe
Opt\Ocaml32\bin\lablgladecc2
Lynx.exe
Opt\Ocaml32\lib\site-lib\lablgtk2\propcc
Bin\xmlif.exe
Opt\Ocaml32\lib\site-lib\lablgtk2\varcc
Apart this long step by step (maybe useless :) ) operation I was finally able to compile QuakeSpasm at 64Bit!!

Really thanks thanks a lot reckless! Your help was very precious! :)
I hope some day to return the favour (I'm a discrete 3d modeler/texturer by the way!) :D

PS: Should I put [SOLVED] on post title now?
Meadow Fun!! - my first commercial game, made with FTEQW game engine
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: QuakeSpasm compile problem

Post by revelator »

Np m8 :) and thanks.

Ok (SOLVED) but if anything is unclear just ask ;) its what im here for.

edit:

Cccc.exe -> is a code analyzer used in C::B.
Lynx.exe -> is a console mode internet browser.
Ocaml -> is a scripting language much like python/perl.
Shell32 and Shell64.exe are just like the cygwin run.exe used for hiding the console from X (a lot of antivirus dont like this behaviour).
Mc.exe is a norton commander clone.
GPG error-> is part of gnupg used for some security operations.
xmlif -> is an xml tool.

If in doubt upload them to your antivirus supplier so they can fix the false positives.
Productivity is a state of mind.
Post Reply