OpenArena Message Boards

OpenArena => Technical Snafus => Topic started by: AceLondon on February 22, 2007, 11:21:41 AM



Title: Source code form linux tarballs won't compile on Windows XP visual studio 2003
Post by: AceLondon on February 22, 2007, 11:21:41 AM
Hi,
  I just downloaded the latest tarballs and tried to compile:
ioq3-svn982/code/win32/msvc/quake3.sln;
Using Visual Studio 2003 .NET which has the C++ compiler version 7.1;

The first error I got seemed to be from q_shared.h defining intptr_t as a typedef.  I tried to change that to just include stddef.h and io.h:
So on line 114 of q_shared.h I now have:
#ifdef Q3_VM
   //typedef int intptr_t;
#include <stddef.h>
#include <io.h>
#else

I got the above solution by searching the web.  I don't know if it is correct to use it.

Even with the above fix (which may be questionable to start with) I still have tons of compile errors for qcommon.h, here are the first few:
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(320): error C2059: syntax error : ')'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(320): error C2059: syntax error : ')'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(321): error C2059: syntax error : ')'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(332): error C2059: syntax error : ')'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(333): error C2059: syntax error : ')'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(337): error C2059: syntax error : ')'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(974): error C2059: syntax error : ')'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(975): error C2059: syntax error : ')'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(975): error C2059: syntax error : ')'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(320): error C2059: syntax error : ','
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(332): error C2059: syntax error : ';'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(333): error C2059: syntax error : ';'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(337): error C2059: syntax error : ';'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(345): error C2059: syntax error : '}'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(332): error C2061: syntax error : identifier 'intValue'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(333): error C2061: syntax error : identifier 'intValue'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(337): error C2061: syntax error : identifier 'x'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(320): error C2081: 'intptr_t' : name in formal parameter list illegal
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(333): error C2081: 'intptr_t' : name in formal parameter list illegal
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(974): error C2081: 'intptr_t' : name in formal parameter list illegal
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(320): error C2091: function returns function
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(974): error C2091: function returns function
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(320): error C2143: syntax error : missing ')' before '('
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(974): error C2143: syntax error : missing ')' before '('
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(320): error C2143: syntax error : missing ')' before '*'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(320): error C2143: syntax error : missing ')' before '*'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(974): error C2143: syntax error : missing ')' before '__cdecl'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(975): error C2143: syntax error : missing ')' before '__cdecl'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(332): error C2143: syntax error : missing ')' before 'identifier'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(333): error C2143: syntax error : missing ')' before 'identifier'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(337): error C2143: syntax error : missing ')' before 'identifier'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(975): error C2143: syntax error : missing ';' before '__cdecl'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(320): error C2143: syntax error : missing '{' before '*'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(320): error C2143: syntax error : missing '{' before '*'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(328): error C2143: syntax error : missing '{' before '__cdecl'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(974): error C2143: syntax error : missing '{' before '__cdecl'
open_arena\source\ioq3-svn982\code\qcommon\qcommon.h(332): error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'


Any help?  I really wanted to compile and play the game on Windows.  Thank you for any help/suggestions.  It would be a great help if someone ran into this same problem and has a solution.



Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 2003
Post by: Redshirt on February 22, 2007, 01:19:19 PM
Try compiling with MinGW.. it's a real pain to get it to compile under visual studio


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: dmn_clown on February 22, 2007, 02:39:28 PM
What's wrong with downloading the Windows .exe?


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: AceLondon on February 22, 2007, 03:21:14 PM
The whole point of having a GPL game is to be able to download it, modify it, and compile/run it yourself!  I haven't tried using Mingwin yet.  I'm a heavy Visual Studio 2003 user and I don't want to have to learn a new IDE just to compile this one project.  Please, anyone who has compiled the source code on Visual Studio let me know how to get around these compliation issues.  If I figure it out I'll post the solution to this thread.

Are the Linux tarballs different from the svn/cvs source?  I tried downloading the SVN source code but the trunk is empty and has no files in it???  Also, would it be possible to compile the Quake3 engine source code from ID and just use the artwork from the Open Arena .pak files with that executable?


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: dmn_clown on February 22, 2007, 04:06:35 PM
The whole point of having a GPL game is to be able to download it, modify it, and compile/run it yourself!  I haven't tried using Mingwin yet.  I'm a heavy Visual Studio 2003 user and I don't want to have to learn a new IDE just to compile this one project.  Please, anyone who has compiled the source code on Visual Studio let me know how to get around these compliation issues.  If I figure it out I'll post the solution to this thread.

Not really, the GPL was written to share knowledge of how something was done and to allow changes when it didn't work as expected.  As ioq3 is mainly coded by GNU/Linux coders, it would stand to reason that MinGW would be the libs that they use.  It is the easiest way to get a cross platform compile from within a GNU/Linux environment.  If you don't want to learn another IDE then simply install Cygwin and run make from within that, no learning necessary, though it is far easier to just download the windows .exe.  No one is going to take your geek points away from you for doing so (-;

Quote
Are the Linux tarballs different from the svn/cvs source?  I tried downloading the SVN source code but the trunk is empty and has no files in it???  Also, would it be possible to compile the Quake3 engine source code from ID and just use the artwork from the Open Arena .pak files with that executable?

0.6 was released several months ago, much has changed since.  Try the svn without the added /trunk (-:


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: AceLondon on February 23, 2007, 10:21:21 AM
ok, I downloaded mingwin and msys and tried to compile the latest source from SVN.  I get this error now from running a straight out make:

code/win32/win_wndproc.c: In function `WIN_DisableAltTab':
code/win32/win_wndproc.c:58: error: `SPI_SCREENSAVERRUNNING' undeclared (first u                                                                             se in this function)
code/win32/win_wndproc.c:58: error: (Each undeclared identifier is reported only                                                                              once
code/win32/win_wndproc.c:58: error: for each function it appears in.)
code/win32/win_wndproc.c: In function `WIN_EnableAltTab':
code/win32/win_wndproc.c:75: error: `SPI_SCREENSAVERRUNNING' undeclared (first u                                                                             se in this function)
make[1]: *** [build/release-mingw32-x86/client/win_wndproc.o] Error 1
make[1]: Leaving directory `source/ioq3-svn982'
make: *** [build_release] Error 2

Any ieads on how to fix this???


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: DieparBaby on February 23, 2007, 11:04:09 AM
Yep.  Change SPI_SCREENSAVERRUNNING to SPI_SETSCREENSAVERRUNNING.  You'll have to do it twice, once in WIN_DisableAltTab and once in WIN_EnableAltTab.

On a related note, I've been cross-compiling on Linux for Windows but I've never been able to successfully see the changes on Windows.  What files do I need to run the mod on windows if I've cross compiled on Linux?  Just the .exe or also some of the dlls?

Sincere thanks,
DieparBaby


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: dmn_clown on February 23, 2007, 11:13:04 AM
Before you do that, though, you should download the latest ioq3 sources and patch it with the diff from your tarball.  There is a buffer overflow in our current engine )-:

I think to run it on windows you need the dlls installed.


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: DieparBaby on February 23, 2007, 11:20:22 AM
Please excuse my ignorance, but where would I put the dlls?  I tried putting them in openarena/source and then running "ioquake +set fs_game source" but that didn't work.  It didn't load any of the dlls.


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: Blaenk on February 23, 2007, 06:25:55 PM
Wow, er, uh...

You can still use Visual Studio. I use visual studio on windows because I have a paid version, otherwise I would use Visual Studio Express, I like Visual Studio, it does help to know gcc (mingw) though, as it helps when compiling on other platforms. Anyways, I haven't tried to compile this particular source. But I figure you simply have to svn, extract the ioquake3 source archive, and apply the patch with something like WinMerge or something.

As for running on windows (And anywhere where wine can run), simply create a tree like this:

/somefolder/binary.exe
/somefolder/baseoa/all three dll's and all of the pk3's

Then you're set. You can run this easily using wine or natively on windows. And yeah I think you should be able to compile id's release source and use oa pk3's, though I don't recommend it. Instead do what I mentioned above.


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: hc on September 24, 2007, 05:58:48 AM
Hi!

Maybe this is a solution to use Visual Studio:
http://www.anupshinde.com/articles/quaked/others/vcpp6inst.htm (http://www.anupshinde.com/articles/quaked/others/vcpp6inst.htm)

I've found it here: http://www.codeproject.com/directx/QuakeD.asp (http://www.codeproject.com/directx/QuakeD.asp)

I don't know if it works because I've never tried it. I've used MinGW.

Steeve


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: next_ghost on September 24, 2007, 06:05:49 AM
The first error I got seemed to be from q_shared.h defining intptr_t as a typedef.  I tried to change that to just include stddef.h and io.h:
So on line 114 of q_shared.h I now have:
#ifdef Q3_VM
   //typedef int intptr_t;
#include <stddef.h>
#include <io.h>
#else

Stupid idea. QVMs run in a virtual machine that doesn't care about the real operating system. That's why they don't include system headers. Revert the changes and post here the original error message.

Please excuse my ignorance, but where would I put the dlls?  I tried putting them in openarena/source and then running "ioquake +set fs_game source" but that didn't work.  It didn't load any of the dlls.

It's openarena/source/vm/


Title: Re: Source code form linux tarballs won't compile on Windows XP visual studio 20
Post by: iLeft.bye on September 24, 2007, 06:25:11 AM
nice necro
my advice: learn to use mingw and try to live without an ide