MALAYA

v17.7.2 does not compile with Mingw

Recommended Posts

Today I tried to compile COD4x v17.7.2 with mingw32. But it gives me those errors.

mingw32-make[1]: Entering directory 'C:/Users/Thamidu Dharshitha/Documents/SF Server/COD4x Project/CoD4x_Server-17.7.2/src/tomcrypt'
TomCrypt start
TomCrypt done
mingw32-make[1]: Leaving directory 'C:/Users/Thamidu Dharshitha/Documents/SF Server/COD4x Project/CoD4x_Server-17.7.2/src/tomcrypt'
g++ obj/db_load.o
src/db_load.cpp: In function 'void DB_LoadedExternalData(int)':
src/db_load.cpp:440:26: error: invalid conversion from 'volatile DWORD* {aka volatile long unsigned int*}' to 'volatile LONG* {aka volatile long int*}' [-fpermissive]
InterlockedExchangeAdd((volatile DWORD*)&g_loadedExternalBytes, size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\mingw\include\windows.h:44:0,
from c:\mingw\include\rpc.h:2,
from c:\mingw\include\objbase.h:3,
from c:\mingw\include\d3d9.h:25,
from src/db_load.cpp:23:
c:\mingw\include\winbase.h:2010:13: note: initializing argument 1 of 'LONG InterlockedExchangeAdd(volatile LONG*, LONG)'
LONG WINAPI InterlockedExchangeAdd (LONG volatile , LONG);
^~~~~~~~~~~~~~~~~~~~~~
src/db_load.cpp: In function 'void DB_AllocXBlocks(unsigned int
, const char*, XBlock*, unsigned int, int)':
src/db_load.cpp:608:17: note: #pragma message: StaticIndexBuffer? StaticVertexBuffer?
#pragma message "StaticIndexBuffer? StaticVertexBuffer?"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/db_load.cpp: In function 'void DB_WaitXFileStage()':
src/db_load.cpp:807:26: error: invalid conversion from 'DWORD* {aka long unsigned int*}' to 'volatile LONG* {aka volatile long int*}' [-fpermissive]
InterlockedIncrement((DWORD*)&g_loadedSize);
^~~~~~~~~~~~~~~~~~~~~
In file included from c:\mingw\include\windows.h:44:0,
from c:\mingw\include\rpc.h:2,
from c:\mingw\include\objbase.h:3,
from c:\mingw\include\d3d9.h:25,
from src/db_load.cpp:23:
c:\mingw\include\winbase.h:2016:13: note: initializing argument 1 of 'LONG InterlockedIncrement(volatile LONG*)'
LONG WINAPI InterlockedIncrement (LONG volatile );
^~~~~~~~~~~~~~~~~~~~
src/db_load.cpp: In function 'void DB_LockWrite()':
src/db_load.cpp:1707:33: error: invalid conversion from 'volatile DWORD
 {aka volatile long unsigned int*}' to 'volatile LONG* {aka volatile long int*}' [-fpermissive]
if ( InterlockedIncrement(&db_hashCritSect.writecount) == 1 && !db_hashCritSect.readcount )
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\mingw\include\windows.h:44:0,
from c:\mingw\include\rpc.h:2,
from c:\mingw\include\objbase.h:3,
from c:\mingw\include\d3d9.h:25,
from src/db_load.cpp:23:
c:\mingw\include\winbase.h:2016:13: note: initializing argument 1 of 'LONG InterlockedIncrement(volatile LONG*)'
LONG WINAPI InterlockedIncrement (LONG volatile );
^~~~~~~~~~~~~~~~~~~~
src/db_load.cpp:1711:28: error: invalid conversion from 'volatile DWORD
 {aka volatile long unsigned int*}' to 'volatile LONG* {aka volatile long int*}' [-fpermissive]
InterlockedDecrement(&db_hashCritSect.writecount);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\mingw\include\windows.h:44:0,
from c:\mingw\include\rpc.h:2,
from c:\mingw\include\objbase.h:3,
from c:\mingw\include\d3d9.h:25,
from src/db_load.cpp:23:
c:\mingw\include\winbase.h:2005:13: note: initializing argument 1 of 'LONG InterlockedDecrement(volatile LONG*)'
LONG WINAPI InterlockedDecrement (LONG volatile );
^~~~~~~~~~~~~~~~~~~~
src/db_load.cpp: In function 'void DB_UnlockWrite()':
src/db_load.cpp:1790:24: error: invalid conversion from 'volatile DWORD
 {aka volatile long unsigned int*}' to 'volatile LONG* {aka volatile long int*}' [-fpermissive]
InterlockedDecrement(&db_hashCritSect.writecount);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\mingw\include\windows.h:44:0,
from c:\mingw\include\rpc.h:2,
from c:\mingw\include\objbase.h:3,
from c:\mingw\include\d3d9.h:25,
from src/db_load.cpp:23:
c:\mingw\include\winbase.h:2005:13: note: initializing argument 1 of 'LONG InterlockedDecrement(volatile LONG*)'
LONG WINAPI InterlockedDecrement (LONG volatile *);
^~~~~~~~~~~~~~~~~~~~
makefile:194: recipe for target 'obj/db_load.o' failed
mingw32-make: *** [obj/db_load.o] Error 1

Share this post


Link to post
Share on other sites

you are most likely using a newer gcc version than we are doing. 

our CI system is building with mingw 5.3 as you can see below. i guess just installing that version would work. 
https://github.com/callofduty4x/CoD4x_Server/blob/dev_newarch/appveyor.yml#L30

 

genuine question: is it too hard to find the correct forum to post a question into? this is the CLIENT forum, you are asking how to compile the SERVER
?!?!?!?

Share this post


Link to post
Share on other sites
5 hours ago, MALAYA said:

Ohhh. I used 6.3. 

that might be the issue then. 

the error actually hints you to use the -fpermissive flag to compile the respective files. if you really want to use 6.3 you could add that flag to your makefile (it downgrades some errors to warnings, new compiler is a bit stricter) .. or even better .. actually fix the bug by changing the cast to the correct type :) 

Share this post


Link to post
Share on other sites

Tried to fix the bugs. Most of the bugs were caused by the passing type to InterlockedIncreament and InterlockedDecreament functions. There were lot of usages of those functions and Im too lazy to fix them 1 by 1. So just I used -fpermissive flag and it worked. Thanks for the help.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.