Compiling Warzone 1.10

Warzone 1.x series. (Aka retail version) (Unsupported!)

Compiling Warzone 1.10

Postby Rodion » 28 May 2010, 14:04

Maybe somebody know how to compile retail 1.10 source code? I tried to compile it in VC++ 6.0 - but it throws away a lot of error messages. Most of them are not about DX6 and Glide, most of them are about syntax. For example -

Code: Select all
j:\warzone\warzone\game\lib\framework\screen.h(33) : error C2061: syntax error : identifier 'screenGetDDObject'
j:\warzone\warzone\game\lib\framework\screen.h(33) : error C2059: syntax error : ';'
j:\warzone\warzone\game\lib\framework\screen.h(33) : error C2059: syntax error : 'type'
j:\warzone\warzone\game\lib\framework\screen.h(36) : error C2061: syntax error : identifier 'screenGetSurface'
j:\warzone\warzone\game\lib\framework\screen.h(36) : error C2059: syntax error : ';'
j:\warzone\warzone\game\lib\framework\screen.h(36) : error C2059: syntax error : 'type'
j:\warzone\warzone\game\lib\framework\screen.h(102) : error C2146: syntax error : missing ')' before identifier 'psSurf'
j:\warzone\warzone\game\lib\framework\screen.h(102) : error C2081: 'LPDIRECTDRAWSURFACE4' : name in formal parameter list illegal
j:\warzone\warzone\game\lib\framework\screen.h(102) : error C2061: syntax error : identifier 'psSurf'
j:\warzone\warzone\game\lib\framework\screen.h(102) : error C2059: syntax error : ';'
j:\warzone\warzone\game\lib\framework\screen.h(102) : error C2059: syntax error : ','
j:\warzone\warzone\game\lib\framework\screen.h(104) : error C2059: syntax error : ')'
j:\warzone\warzone\game\lib\framework\screen.h(113) : error C2146: syntax error : missing ')' before identifier 'psSurf'
j:\warzone\warzone\game\lib\framework\screen.h(113) : error C2081: 'LPDIRECTDRAWSURFACE4' : name in formal parameter list illegal
j:\warzone\warzone\game\lib\framework\screen.h(113) : error C2061: syntax error : identifier 'psSurf'
j:\warzone\warzone\game\lib\framework\screen.h(113) : error C2059: syntax error : ';'
j:\warzone\warzone\game\lib\framework\screen.h(113) : error C2059: syntax error : ','


and so on. I'm compiling in VC++ 6.0 without SP, maybe I need them? I don't think that programmers in Pumpkin did such a big amount of syntax errors - Warzone 1.10 is working - so the solution is somewhere in other place, not in editing these more than 1000 errors for each library. I tried to compile it in VCExpress 2008 but there are also a lot of syntax errors. In readme.txt in source code directory - nothing is said about how to compile Warzone.

Also maybe some body know where to find full Glide distributive? I've found some on sourceforge, but it is not full - there is no 3DFX.h and maybe other files. So for now I'm decided simply to switch it off. But maybe somebody have it - to not to comment out by hand everything, that is connected with it.

And also - I want to compile exactly this version - there is no need to send me on 2.3.0 - I know about it.
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Re: Compiling Warzone 1.10

Postby stiv » 28 May 2010, 16:27

You need to look at the *first* errors in the log and fix those. I suspect you have some missing include files. Once you fix those a lot of the others will go away.

Rule of thumb:

No such file msgs mean you are missing a header or do not have the right include paths.

Undefined symbols mean you are not linking against a needed library. Either something is not installed or your library paths are wrong.
stiv
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 876
Joined: 18 Jul 2008, 04:41
Location: 45N 86W

Re: Compiling Warzone 1.10

Postby Rodion » 28 May 2010, 17:02

Here is the beginning of the compiling results -

Code: Select all
--------------------Configuration: Framework - Win32 Debug--------------------
Compiling...
Block.c
j:\warzone\warzone\game\lib\framework\block.c(430) : warning C4102: 'NoMemChk' : unreferenced label
j:\warzone\warzone\game\lib\framework\block.c(538) : warning C4101: 'bRes' : unreferenced local variable
Cursor.c
j:\warzone\warzone\game\lib\framework\surface.h(22) : error C2143: syntax error : missing ')' before '*'
j:\warzone\warzone\game\lib\framework\surface.h(22) : error C2143: syntax error : missing '{' before '*'
j:\warzone\warzone\game\lib\framework\surface.h(23) : warning C4142: benign redefinition of type
j:\warzone\warzone\game\lib\framework\surface.h(23) : error C2370: 'UDWORD' : redefinition; different storage class
        j:\warzone\warzone\game\lib\framework\types.h(25) : see declaration of 'UDWORD'
j:\warzone\warzone\game\lib\framework\surface.h(23) : error C2146: syntax error : missing ';' before identifier 'width'
j:\warzone\warzone\game\lib\framework\surface.h(23) : error C2059: syntax error : 'type'
j:\warzone\warzone\game\lib\framework\surface.h(27) : error C2059: syntax error : ')'
j:\warzone\warzone\game\lib\framework\surface.h(31) : error C2146: syntax error : missing ')' before identifier 'psSurface'
j:\warzone\warzone\game\lib\framework\surface.h(31) : error C2061: syntax error : identifier 'psSurface'
j:\warzone\warzone\game\lib\framework\surface.h(31) : error C2059: syntax error : ';'
j:\warzone\warzone\game\lib\framework\surface.h(31) : error C2059: syntax error : ')'
j:\warzone\warzone\game\lib\framework\surface.h(34) : error C2143: syntax error : missing ')' before '*'
j:\warzone\warzone\game\lib\framework\surface.h(34) : error C2143: syntax error : missing '{' before '*'
j:\warzone\warzone\game\lib\framework\surface.h(34) : error C2059: syntax error : ')'
j:\warzone\warzone\game\lib\framework\surface.h(38) : error C2146: syntax error : missing ')' before identifier 'psSurf'
j:\warzone\warzone\game\lib\framework\surface.h(38) : error C2061: syntax error : identifier 'psSurf'
j:\warzone\warzone\game\lib\framework\surface.h(38) : error C2059: syntax error : ';'
j:\warzone\warzone\game\lib\framework\surface.h(38) : error C2059: syntax error : ','
j:\warzone\warzone\game\lib\framework\surface.h(41) : error C2059: syntax error : ')'
j:\warzone\warzone\game\lib\framework\surface.h(47) : error C2146: syntax error : missing ')' before identifier 'psDest'
j:\warzone\warzone\game\lib\framework\surface.h(47) : error C2061: syntax error : identifier 'psDest'
j:\warzone\warzone\game\lib\framework\surface.h(47) : error C2059: syntax error : ';'
j:\warzone\warzone\game\lib\framework\surface.h(47) : error C2059: syntax error : ','
j:\warzone\warzone\game\lib\framework\surface.h(48) : error C2059: syntax error : ')'
j:\warzone\warzone\game\lib\framework\surface.h(53) : error C2143: syntax error : missing ')' before '*'
j:\warzone\warzone\game\lib\framework\surface.h(53) : error C2081: 'LPDIRECTDRAWSURFACE4' : name in formal parameter list illegal
j:\warzone\warzone\game\lib\framework\surface.h(53) : error C2143: syntax error : missing '{' before '*'
j:\warzone\warzone\game\lib\framework\surface.h(54) : warning C4142: benign redefinition of type
j:\warzone\warzone\game\lib\framework\surface.h(54) : error C2370: 'UDWORD' : redefinition; different storage class
        j:\warzone\warzone\game\lib\framework\types.h(25) : see declaration of 'UDWORD'
j:\warzone\warzone\game\lib\framework\surface.h(54) : error C2143: syntax error : missing ';' before '*'
j:\warzone\warzone\game\lib\framework\surface.h(55) : warning C4142: benign redefinition of type
j:\warzone\warzone\game\lib\framework\surface.h(55) : error C2370: 'UDWORD' : redefinition; different storage class
        j:\warzone\warzone\game\lib\framework\types.h(25) : see declaration of 'UDWORD'


The first error - "j:\warzone\warzone\game\lib\framework\surface.h(22) : error C2143: syntax error : missing ')' before '*'"
points to this code -

Code: Select all
/* Create a DD surface.
 *
 * If caps is 0 and psPixFormat is NULL the surface will be created in
 * video memory if there is room (system memory otherwise) and will use
 * the pixel format of the display.
 */
extern BOOL surfCreate(LPDIRECTDRAWSURFACE4   *ppsSurface,   // The created surface
                  UDWORD width, UDWORD height,         // The size of the surface
                  UDWORD            caps,         // The caps bits for the surface
                  DDPIXELFORMAT      *psPixFormat,   // The pixel format for the surface
                  BOOL               bColourKey,      // Colour key flag
                  BOOL               bAddToList   );   // Add pointer to surface list


Line 22 here is - "extern BOOL surfCreate(LPDIRECTDRAWSURFACE4 *ppsSurface, // The created surface". And there is no "no such file" or "symbol is undefined". I'm not specialist in C and C++, but maybe if majority of the Warzone code in ".c" files - they must be interpreted as pure C files, not C++. Maybe reason of this errors is in that VC looks on this files as C++, but they are written in C. But maybe I'm wrong and VC distinguishes them automatically. By the way I'm programming in Windows 7, but this, faster of all - must not affect compiling process and raise syntax errors.

Or maybe there are some changes in new Service Packs and WZ is written in VC with these SPs. But in "Warzone.dsp" and "Warzone.dsw" in source archive it is written -

Code: Select all
# Microsoft Developer Studio Project File - Name="Warzone" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **


and

Code: Select all
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!


accordingly. So "6.0" means that VC, which was used by Pumpkin, is without SPs.
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Re: Compiling Warzone 1.10

Postby Zarel » 28 May 2010, 19:13

missing ')' before '*' -> LPDIRECTDRAWSURFACE4 isn't defined, and so is being interpreted as raw text instead of as a typedef'd type, which means you are missing a library.

The rest of your speculation about interpreting as C or interpreting as C++ is meaningless until you can find that library.
User avatar
Zarel
Elite
Elite
 
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Compiling Warzone 1.10

Postby Rodion » 28 May 2010, 20:30

With very hard search I've found Glide SDK here - "http://www.falconfly.de/reference.htm" .
DirectX 6 include and lib files are in VC 6.0 install directory. Maybe WZ wants some kind of DirectX 6 SDK - if it exists at all - or some kind of DirectDraw libraries?
Now there is no "file not found". For now I'm trying to compile only library ivis02 to reduce amount of work, but when compiling full game - the same errors occuring as when compiling only library.

Also there are such errors -

Code: Select all
j:\warzone\warzone\game\lib\framework\surface.h(58) : error C2370: 'COLORREF' : redefinition; different storage class
        j:\program files\microsoft\visual studio 6.0\vc98\include\windef.h(281) : see declaration of 'COLORREF'


Maybe Warzone redefines some variables, constants and types, that are presented in standard VC libraries? Please, Zarel, help - alone I will search solution for a loooong time.
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Re: Compiling Warzone 1.10

Postby Rodion » 28 May 2010, 20:57

Strange - I've cut from project options string '/I "..\Framework"' and VC started to show such error messages -

Code: Select all
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(22) : error C2061: syntax error : identifier 'BYTE'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(23) : error C2061: syntax error : identifier 'SrcAddr'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(23) : error C2059: syntax error : ';'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(23) : error C2059: syntax error : '['
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(26) : error C2061: syntax error : identifier 'WORD'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(27) : error C2061: syntax error : identifier 'Type'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(27) : error C2059: syntax error : ';'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(28) : error C2059: syntax error : '}'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(29) : error C2061: syntax error : identifier 'Info'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(29) : error C2059: syntax error : ';'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(29) : error C2059: syntax error : '['
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(30) : error C2059: syntax error : '}'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(32) : error C2143: syntax error : missing '{' before '*'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(34) : error C2061: syntax error : identifier 'UNALIGNED'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(34) : error C2059: syntax error : ';'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(50) : error C2061: syntax error : identifier 'BYTE'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(51) : error C2061: syntax error : identifier 'FrameCtrl'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(51) : error C2059: syntax error : ';'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(52) : error C2061: syntax error : identifier 'DstAddr'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(52) : error C2059: syntax error : ';'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(52) : error C2059: syntax error : '['
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(53) : error C2061: syntax error : identifier 'SrcAddr'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(53) : error C2059: syntax error : ';'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(53) : error C2059: syntax error : '['
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(56) : error C2061: syntax error : identifier 'BYTE'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(57) : error C2061: syntax error : identifier 'RoutingInfo'
j:\program files\microsoft\visual studio 6.0\vc98\include\frame.h(57) : error C2059: syntax error : ';'


Here project's options - maybe they somehow will help -

/nologo /MLd /W3 /Gm /GX /ZI /Od /I "J:\Warzone\Warzone\Game\LIB\Glide\3Dfx\Sdk\Glide3x\Src\Include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "INC_GLIDE" /D "__MSC__" /FR"Debug/" /Fp"Debug/Ivis02.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c

and this is what VC writes in the end of compiling log -

Code: Select all
j:\warzone\warzone\game\lib\ivis02\ivisdef.h(248) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.

Ivis02.lib - 2758 error(s), 0 warning(s)
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Re: Compiling Warzone 1.10

Postby Rodion » 28 May 2010, 21:26

Also, I was able to find reduced version of DirectX 7 SDK - it contains only inc and lib files - here - "http://alleg.sourceforge.net/files/dx70_min.zip". As far as I understand - DX7 - backward compatible with DX6 - there is only need to use old interfaces. I wrote in VC directories paths to DX7 SDK's inc and lib files, but result is the same. And it seems SDK contains the same files as in VC's directories.

By the way - the only place, where I was able to find original 1.10 version source code, is here - "http://www.atomicgamer.com/files/34855/warzone2100-rar" - there is need to wait some minutes after choosing the mirror, but everything works fine. So those, who are interested in these source codes - hurry up, while they are still easily available.
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Re: Compiling Warzone 1.10

Postby EvilGuru » 29 May 2010, 01:28

Try checking out an early SVN revision of this project. We have gone to great lengths to preserve the history of the code over the past five or so years. It is likely that several of the early commits (pre-Linux support) deal with getting the game to compile.

The detailed change-sets will allow you to determine exactly what was changed between revisions. Doing so should allow you to get the pure 1.10 experience you desire without needing to reinvent the wheel.

Polemically yours, Freddie.
EvilGuru
Regular
Regular
 
Posts: 615
Joined: 23 Jun 2007, 22:41

Re: Compiling Warzone 1.10

Postby Rodion » 29 May 2010, 10:58

So, I tried ver 1.10a from Sourceforge SVN repository from tags and 0.2 release source code from gna - result is the same, but with less errors.

Then I tried following - took Glide and DirectX 7 SDK and wrote paths to their lib and inc files in VC 2008 - almost everything did compiled. Then I disabled definition of symbol /D "INC_GLIDE" and by hand manually commented out all source code, connected with Glide - it is often constants started with GR - possibly Glide Renderer. Now amount of errors reduced much more - only one file was full of references to Glide - it starts from 3dfx and ends on .h or .c - I don't remember which one exactly - but these files are few and errors point to it - so it can be easily found. So I deleted it from project. Now ivis02 successfully compiled!

Then I tried to compile full game - there are some references to dglide.h in game's source code, so I by hand commented out all its inclusions and then all source code parts, connected with it. They again are usually constants, started with GR, and they are placed in code, that looks like -

Code: Select all
if(pie_GetRenderEngine() == ENGINE_GLIDE)
{
  ...
}


so I commented out all this code. Now on the way of compilation stands only one file - afxres.h - it is not connected to Warzone, it is connected to VC 2008 itself - it is part of MFC - and as far, as I understood from internet forums - VC inserts this file in all resource files, even if they do not use MFC. So the easiest solution - is simply comment it out. And the last thing before the compilation is in the same .rc file - VC don't like string "LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK" - it says language is not integer or something like this - so the familiar way of fighting with VC - comment it out! Now compilation works fine :-) .

But then the next barricade appears on the way - VC starts on linking stage complain on unresolved external symbol or link to unresolved external symbol -

Code: Select all
3>------ Построение начато: проект: Warzone, Конфигурация: Debug Win32 ------
3>Компоновка...
3>WinMain.obj : error LNK2001: неразрешенный внешний символ "_dbg_Assert"

...

3>AStar.obj : error LNK2001: неразрешенный внешний символ "_dbg_Assert"
3>WinMain.obj : error LNK2001: неразрешенный внешний символ "_dbg_AssertPosition"

...

3>AStar.obj : error LNK2001: неразрешенный внешний символ "_dbg_AssertPosition"
3>Visibility.obj : error LNK2001: неразрешенный внешний символ "_frameTime"

...

3>Effects.obj : error LNK2001: неразрешенный внешний символ "_frameTime"
3>Action.obj : error LNK2019: ссылка на неразрешенный внешний символ _trigIntSqrt в функции _actionTargetTurret
3>Move.obj : error LNK2001: неразрешенный внешний символ "_trigIntSqrt"
3>projectile.obj : error LNK2001: неразрешенный внешний символ "_trigIntSqrt"
3>Visibility.obj : error LNK2001: неразрешенный внешний символ "_dbg_printf"

...

3>CDSpan.obj : error LNK2001: неразрешенный внешний символ "_dbg_printf"
3>Selection.obj : error LNK2001: неразрешенный внешний символ "_memPointerValid"

...

3>CmdDroid.obj : error LNK2001: неразрешенный внешний символ "_memPointerValid"
3>Action.obj : error LNK2019: ссылка на неразрешенный внешний символ _audio_QueueTrackMinDelay в функции _actionUpdateDroid
3>Order.obj : error LNK2001: неразрешенный внешний символ "_audio_QueueTrackMinDelay"
3>seqDisp.obj : error LNK2001: неразрешенный внешний символ "_eventFireCallbackTrigger"

...

3>Display.obj : error LNK2001: неразрешенный внешний символ "_eventFireCallbackTrigger"
3>Target.obj : error LNK2001: неразрешенный внешний символ "_gameTime"

...

3>Combat.obj : error LNK2001: неразрешенный внешний символ "_gameTime"

...

3>Stats.obj : error LNK2001: неразрешенный внешний символ "_resGetData"

...

3>Init.obj : error LNK2001: неразрешенный внешний символ "_resGetData"
3>IntImage.obj : error LNK2001: неразрешенный внешний символ "_resGetData"
3>MapGrid.obj : error LNK2001: неразрешенный внешний символ "_heapCreate"

...

3>Group.obj : error LNK2001: неразрешенный внешний символ "_heapCreate"
3>Message.obj : error LNK2001: неразрешенный внешний символ "_heapSetCallPos"

...

3>Droid.obj : error LNK2001: неразрешенный внешний символ "_heapSetCallPos"
3>MapGrid.obj : error LNK2001: неразрешенный внешний символ "_heapDestroy"

...

3>Arrow.obj : error LNK2019: ссылка на неразрешенный внешний символ _heapDestroy в функции _arrowShutDown
3>AStar.obj : error LNK2001: неразрешенный внешний символ "_heapDestroy"
3>Formation.obj : error LNK2001: неразрешенный внешний символ "_heapDestroy"
3>Group.obj : error LNK2001: неразрешенный внешний символ "_heapDestroy"
3>Message.obj : error LNK2001: неразрешенный внешний символ "_heapAlloc"

...

3>Droid.obj : error LNK2001: неразрешенный внешний символ "_heapAlloc"
3>ObjMem.obj : error LNK2001: неразрешенный внешний символ "_heapFree"

...

3>Droid.obj : error LNK2001: неразрешенный внешний символ "_heapFree"
3>WinMain.obj : error LNK2019: ссылка на неразрешенный внешний символ _pie_SetFogStatus в функции _WinMain@16
3>Wrappers.obj : error LNK2001: неразрешенный внешний символ "_pie_SetFogStatus"
3>Texture.obj : error LNK2001: неразрешенный внешний символ "_memMalloc"

...

3>Effects.obj : error LNK2001: неразрешенный внешний символ "_memMalloc"
3>structure.obj : error LNK2001: неразрешенный внешний символ "_memFree"

...

3>Effects.obj : error LNK2001: неразрешенный внешний символ "_memFree"
3>AStar.obj : error LNK2019: ссылка на неразрешенный внешний символ _heapReset в функции _fpathHashReset
3>MapDisplay.obj : error LNK2001: неразрешенный внешний символ "_pie_MatEnd"

...

3>Component.obj : error LNK2001: неразрешенный внешний символ "_pie_MatEnd"
3>Effects.obj : error LNK2019: ссылка на неразрешенный внешний символ _pie_Draw3DShape в функции _addEffect

...

3>display3d.obj : error LNK2001: неразрешенный внешний символ "_pie_Draw3DShape"
3>projectile.obj : error LNK2019: ссылка на неразрешенный внешний символ _pie_MatRotX в функции _proj_SendProjectile
3>structure.obj : error LNK2001: неразрешенный внешний символ "_pie_MatRotX"

...

3>display3d.obj : error LNK2001: неразрешенный внешний символ "_pie_MatRotY"
3>MapDisplay.obj : error LNK2019: ссылка на неразрешенный внешний символ _psMatrix в функции _drawMapTile2
3>projectile.obj : error LNK2001: неразрешенный внешний символ "_psMatrix"

...

3>Component.obj : error LNK2001: неразрешенный внешний символ "_psMatrix"

...

3>WinMain.obj : error LNK2001: неразрешенный внешний символ "_dbg_ErrorBox"

...

3>Console.obj : error LNK2001: неразрешенный внешний символ "_dbg_ErrorBox"
3>structure.obj : error LNK2001: неразрешенный внешний символ "_dbg_ErrorPosition"

...

3>Console.obj : error LNK2001: неразрешенный внешний символ "_dbg_ErrorPosition"
3>Wrappers.obj : error LNK2001: неразрешенный внешний символ "_pie_Hardware"

...

3>Effects.obj : error LNK2001: неразрешенный внешний символ "_pie_Hardware"

... ... ...

3>ScriptExtern.obj : error LNK2019: ссылка на неразрешенный внешний символ _stackPop в функции _scrGenExternSet
3>ScriptFuncs.obj : error LNK2001: неразрешенный внешний символ "_stackPop"
3>ScriptFuncs.obj : error LNK2019: ссылка на неразрешенный внешний символ _widgSetButtonFlash в функции _scrFlashOn
3>ScriptFuncs.obj : error LNK2019: ссылка на неразрешенный внешний символ _widgClearButtonFlash в функции _scrFlashOff
3>ScriptObj.obj : error LNK2019: ссылка на неразрешенный внешний символ _sound_GetTrackHashName в функции _scrValDefSave
3>ScriptObj.obj : error LNK2019: ссылка на неразрешенный внешний символ _strresGetIDfromString в функции _scrValDefSave
3>ScriptObj.obj : error LNK2019: ссылка на неразрешенный внешний символ _audio_SetTrackValsHashName в функции _scrValDefLoad
3>ScriptObj.obj : error LNK2019: ссылка на неразрешенный внешний символ _audio_GetAvailableID в функции _scrValDefLoad
3>ScriptObj.obj : error LNK2019: ссылка на неразрешенный внешний символ _audio_GetTrackIDFromHash в функции _scrValDefLoad
3>ScriptTabs.obj : error LNK2001: неразрешенный внешний символ "_eventSetTraceLevel"
3>ScriptTabs.obj : error LNK2001: неразрешенный внешний символ "_eventSetTrigger"
3>ScriptTabs.obj : error LNK2001: неразрешенный внешний символ "_interpTraceOff"
3>ScriptTabs.obj : error LNK2001: неразрешенный внешний символ "_interpTraceOn"
3>ScriptTabs.obj : error LNK2019: ссылка на неразрешенный внешний символ _eventAddValueRelease в функции _scrTabInitialise
3>ScriptTabs.obj : error LNK2019: ссылка на неразрешенный внешний символ _eventAddValueCreate в функции _scrTabInitialise
3>ScriptTabs.obj : error LNK2019: ссылка на неразрешенный внешний символ _scriptSetTypeEquiv в функции _scrTabInitialise

...

3>WinMain.obj : error LNK2019: ссылка на неразрешенный внешний символ _blkInitialise в функции _WinMain@16
3>WinMain.obj : error LNK2019: ссылка на неразрешенный внешний символ _memInitialise в функции _WinMain@16
3>WinMain.obj : error LNK2019: ссылка на неразрешенный внешний символ _InitGlideDLL в функции _WinMain@16
3>WinMain.obj : error LNK2019: ссылка на неразрешенный внешний символ _pie_CheckForDX6 в функции _WinMain@16
3>Wrappers.obj : error LNK2019: ссылка на неразрешенный внешний символ _pie_ResetBackDrop в функции _initLoadingScreen
3>Wrappers.obj : error LNK2019: ссылка на неразрешенный внешний символ _resSetLoadCallback в функции _initLoadingScreen


it is partially in Russian - LNK2019 - it is link to unresolved external symbol - and LNK2001 - is unresolved external symbol. Amount of all unresolved external elements is 451. I understand problem now on linking stage - so I manually add projects of all game libs to Warzone solution, compile it with them, with little errors - everything compiled, after solving them. But then again the unresolved symbols. So I by hand wrote down paths to all game libs in VC 2008 libs directories. But still the same errors. So how to solve now them? How to resolve these external symbols?

By the way VC 2008 has option to compile project as C or as C++. It is accessible in Project Properties -> C/C++ -> Additional. if it is not changed it is set to C++ and project compiles fine, if it is manually set to C - also fine, but if it is set manually to C++ - project fails to compile. It seems if it is not set by hand VC automatically recognizes C or C++ files and compiles them accordingly. So for now I've set every project to "Compile as C". But either when I did not set this property at all or set it to C - the same unresolved symbol errors appear.
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Re: Compiling Warzone 1.10

Postby Rodion » 29 May 2010, 13:21

Victory is near!

I've set in dependencies of Warzone project - projects of all game libs - and amount of unresolved external symbols - reduced to 30 with something. It seems that VC do not set dependencies automatically. Majority of these symbols are connected with Glide, so I've again commented them out. They look like -

unresolved external symbol _SymbolName in function _FunctionName

I've searched either SymbolName or FunctionName without sign "_" and commented out all Glide code. There was only one unresolved external symbol, that is not connected to the Glide - "__input" - with 2 "_" symbols, in source code it refered to function "_input" with one "_" symbol. So I've deleted this symbol and left only "input". And VC do not complain about it now.

Now there are only left errors - that some symbols, defined in MSVCRTD, are already defined in other libs -

Code: Select all
1>------ Построение начато: проект: Warzone, Конфигурация: Debug Win32 ------
1>Компоновка...
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _rand уже определен в LIBCMTD.lib(rand.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __wassert уже определен в LIBCMTD.lib(wassert.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _sprintf уже определен в LIBCMTD.lib(sprintf.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _strncpy уже определен в LIBCMTD.lib(strncpy.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _vsprintf уже определен в LIBCMTD.lib(vsprintf.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _isdigit уже определен в LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _strncmp уже определен в LIBCMTD.lib(strncmp.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _strstr уже определен в LIBCMTD.lib(strstr.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _strchr уже определен в LIBCMTD.lib(strchr.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _memmove уже определен в LIBCMTD.lib(memmove.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fclose уже определен в LIBCMTD.lib(fclose.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fwrite уже определен в LIBCMTD.lib(fwrite.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fopen уже определен в LIBCMTD.lib(fopen.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fread уже определен в LIBCMTD.lib(fread.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _atol уже определен в LIBCMTD.lib(atox.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _putc уже определен в LIBCMTD.lib(fputc.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _exit уже определен в LIBCMTD.lib(crt0dat.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _fprintf уже определен в LIBCMTD.lib(fprintf.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: ___iob_func уже определен в LIBCMTD.lib(_file.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _malloc уже определен в LIBCMTD.lib(dbgmalloc.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free уже определен в LIBCMTD.lib(dbgfree.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _isalnum уже определен в LIBCMTD.lib(_ctype.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _atoi уже определен в LIBCMTD.lib(atox.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _strrchr уже определен в LIBCMTD.lib(strrchr.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _srand уже определен в LIBCMTD.lib(rand.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _clock уже определен в LIBCMTD.lib(clock.obj)
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) уже определен в LIBCMTD.lib(typinfo.obj)
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) уже определен в LIBCMTD.lib(typinfo.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: __stricmp уже определен в LIBCMTD.lib(stricmp.obj)
1>LINK : warning LNK4098: библиотека по умолчанию "MSVCRTD" противоречит использованию других библиотек; используйте параметр /NODEFAULTLIB:library
1>.\Debug/Warzone.exe : fatal error LNK1169: обнаружен многократно определенный символ - один или более


There is at the end advise to disable using of MSVCRTD and LNK1169 - multiple definitions of symbols. So, I tried to do as linker advises in Project Properties -> Linker - > Input I've setted in "Ignore specified library" - MSVCRTD. And now there are such errors -

Code: Select all
1>------ Построение начато: проект: Warzone, Конфигурация: Debug Win32 ------
1>Компоновка...
1>projectile.obj : warning LNK4049: импортирован локально определенный символ _rand
1>ScriptFuncs.obj : warning LNK4217: локально определенный символ _rand импортирован в функцию _scrMakeComponentAvailable
1>structure.obj : warning LNK4049: импортирован локально определенный символ _rand
1>Wrappers.obj : warning LNK4049: импортирован локально определенный символ _rand
1>MultiOpt.obj : warning LNK4049: импортирован локально определенный символ _rand

...

1>seqDisp.obj : warning LNK4049: импортирован локально определенный символ _strrchr
1>ScriptFuncs.obj : warning LNK4217: локально определенный символ _srand импортирован в функцию _scrRandomiseSeed
1>ScriptFuncs.obj : warning LNK4217: локально определенный символ _clock импортирован в функцию _scrRandomiseSeed
1>OLDNAMES.lib(stricmp.obi) : warning LNK4049: импортирован локально определенный символ __stricmp
1>CDSpan.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__strtok в функции _cdspan_GetDriveName
1>clParse.obj : error LNK2001: неразрешенный внешний символ "__imp__strtok"
1>seqDisp.obj : error LNK2001: неразрешенный внешний символ "__imp__strtok"
1>clParse.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp___chdir в функции _ParseCommandLine
1>clParse.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__strncat в функции _ParseCommandLine
1>Research.obj : error LNK2001: неразрешенный внешний символ "__imp__sscanf"
1>seqDisp.obj : error LNK2001: неразрешенный внешний символ "__imp__sscanf"
1>Stats.obj : error LNK2001: неразрешенный внешний символ "__imp__sscanf"
1>structure.obj : error LNK2001: неразрешенный внешний символ "__imp__sscanf"
1>Droid.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__sscanf в функции _loadDroidTemplates
1>Feature.obj : error LNK2001: неразрешенный внешний символ "__imp__sscanf"
1>Function.obj : error LNK2001: неразрешенный внешний символ "__imp__sscanf"
1>Gateway.obj : error LNK2001: неразрешенный внешний символ "__imp__sscanf"
1>IntDisplay.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__itoa в функции _intDisplayPowerBar
1>OLDNAMES.lib(itoa.obi) : error LNK2001: неразрешенный внешний символ "__imp__itoa"
1>MultiInt.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__system в функции _runConnectionScreen
1>MultiInt.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__div в функции _displayWhiteBoard
1>OLDNAMES.lib(itoa.obi) : error LNK2001: неразрешенный внешний символ "__imp___itoa"


VC warns that locally defined symbol is imported and in the end - says that some symbols are undefined, it seems, that they are defined in MSVCRTD. Total their amount is 8 - VC writes so. So where to find libs with these symbols or how to make so that MSVCRTD will work with Warzone? Symbols, that are needed without VCRTD, are - __imp__strtok, __imp___chdir, __imp__strncat, __imp__sscanf, __imp__itoa, __imp__system and __imp__div. So, as far as I understand - VC needs procedures strtok, chdir, strncat, sscanf, itoa, system and div - where to find them?
Last edited by Rodion on 29 May 2010, 13:41, edited 1 time in total.
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Re: Compiling Warzone 1.10

Postby Rodion » 29 May 2010, 13:37

Victory! It is Victory! At last it is victory! My happiness have no borders - it compiles, links and even works!

So before I've setted in Linker -> Common -> Use input data of libs from dependencies. Now I've switched it off and then VC started to show that libs MSVCRTD and LIBCMTD have similar symbols - so from two of them - I switched off LIBCMTD and now it works!

So everybody - thank you - thanks for the answers, I hope this conversation will help to those, who want to compile original source. Have a nice day - I'm going to Create!
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Re: Compiling Warzone 1.10

Postby Rodion » 29 May 2010, 15:13

One moment about that function _input - it is better not to change its name - after this change, while loading game - error occurs. It is better completely replace file imdload.c in ivis02 library and files Droid.c and Message.c from game src dir with files from distributive version 0.2. Thanks to wz2100 team for the work.
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Re: Compiling Warzone 1.10

Postby Rodion » 29 May 2010, 18:09

I have some question - when I'm starting One Player Skirmish or Hosting net play - after I press button - begin hosting game - appears panel, where I can choose players' colors and AI's strength - so on this screen all time appears error -

Debug assertion failed.
program: ...\Warzone.exe
file : ...\self_x86\crt\src\fprinf.c
line: 50
Expression: (str != NULL)

It appears either after some time, even if I do nothing, or when I press Ok - begin game. It was in original exe, that was in source code archive, when I've setted up patch 1.10 - everything started to work fine, but now, when I'm compiling from source code, exe from patch is overwritten by newly compiled - so, it do not affect game anymore. Maybe somebody of developers remember - how did you solved this problem? For now I do not even know from where to start searching - error, it seems, is raised from internal VC libraries, but source of the error, it seems, somewhere in the game, but it is some kind of task - find don't know what error, in don't know what function, in don't know what module.

Edit - forgot to say - this error do not occurs, when I start simple Campaign.
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Re: Compiling Warzone 1.10

Postby Crymson » 30 May 2010, 20:06

That means that str was NULL.

Post your code changes.
User avatar
Crymson
Trained
Trained
 
Posts: 289
Joined: 18 Mar 2010, 21:08

Re: Compiling Warzone 1.10

Postby Rodion » 31 May 2010, 08:34

Ok, thank you, Crymson, I've already found that multiplayer initialization menu is placed in MultiInit.c - so I dig from there.

I will post, when I will have major changes to the engine, because I have mobile internet and uploading big files - is somehow problematic. For now my target is to translate the engine to DirectX 9 - when I will do so - I'll post the changed source code.

Edit - source code itself - src + lib - is not so big - only 1,3 MB, so I've posted it here - "http://rodionkarimov.narod.ru/programs/games/strategies/warzone_2100/Warzone_2100_1_10_1.7z". There are no resources and utilities - they can be found in full 1.10 source code releases on links provided upper.

For now I'm already made current DX 6 renderer work in 32 bits per pixel mode, but there are some problems with transparency - errors occur - and with the drawing background images in menu, maps previews in multiplayer menu and in briefings. For now I will not try to solve it in DirectDraw + DirectX 6 - I will translate it in DirectX 9 and solve these problems while translating. But to those, who want turn back 16 bits per pixel color - there is need to revert back my changes in file d3drenderer.c - in ivis02 directory - I did not deleted original code - I've commented it - so you can make reverse operation - comment out my code and uncomment original. In this file - there is also need need to turn back 16 bits z-buffer, I've made it 24 bits. Changes are placed in functions GetWindowsMode and CreateZBuffer. Also - there is need to uncomment strings -

Code: Select all
//#define DISP_HARDBITDEPTH   (16)
//#define DISP_BITDEPTH   (8)


and comment -

Code: Select all
#define DISP_HARDBITDEPTH   (32)
#define DISP_BITDEPTH   (32)


in file SRC\DisplayDef.h. That's it.
Rodion
Greenhorn
 
Posts: 13
Joined: 28 May 2010, 13:42
Location: Russia, Yekaterinburg

Next

Return to 1.x

cron