• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Building in wine on Linux?

codiac

Chieftain
Joined
Oct 15, 2022
Messages
55
I've recent switched to Linux and have the mod running on steam, but I'd like to be able to build the develop branch. Has anyone done this?

I have Strawberry Perl installed in wine but when I try to compile I get some odd output.

Spoiler Build Log :

bin\Compile.bat Assert
014c:fixme:heap:RtlSetHeapInformation HEAP_INFORMATION_CLASS 1 not implemented!
Building headers
Testing DllExport
01a8:fixme:file:server_get_file_info Unsupported info class e
01a8:fixme:file:server_get_file_info Unsupported info class e
01a8:fixme:file:server_get_file_info Unsupported info class e
01b8:fixme:file:server_get_file_info Unsupported info class e
01b8:fixme:file:server_get_file_info Unsupported info class e
01b8:fixme:file:server_get_file_info Unsupported info class e
01c0:fixme:file:server_get_file_info Unsupported info class e
01c0:fixme:file:server_get_file_info Unsupported info class e
01c0:fixme:file:server_get_file_info Unsupported info class e
01c8:fixme:file:server_get_file_info Unsupported info class e
01c8:fixme:file:server_get_file_info Unsupported info class e
01c8:fixme:file:server_get_file_info Unsupported info class e
01d0:fixme:file:server_get_file_info Unsupported info class e
01d0:fixme:file:server_get_file_info Unsupported info class e
01d0:fixme:file:server_get_file_info Unsupported info class e
Building source list
01e0:fixme:file:server_get_file_info Unsupported info class e
01e0:fixme:file:server_get_file_info Unsupported info class e
01e0:fixme:file:server_get_file_info Unsupported info class e
01f0:fixme:file:server_get_file_info Unsupported info class e
01f0:fixme:file:server_get_file_info Unsupported info class e
01f0:fixme:file:server_get_file_info Unsupported info class e
Syntax error: unexpected IN
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
0200:fixme:file:server_get_file_info Unsupported info class e
Testing python files using 12 threads
jom: Project Files\Makefile [source_list_building] Error 255
Press any key to continue... 0238:fixme:file:server_get_file_info Unsupported info class e
0238:fixme:file:server_get_file_info Unsupported info class e
0238:fixme:file:server_get_file_info Unsupported info class e
 
First of all, any perl will do. It doesn't have to be windows perl. Any linux perl distribution will do as long as you include the correct modules. I intentionally made sure only to use modules included with Strawberry perl as that makes it easier to get it working for people with no knowledge about setting up compilers and libraries.

Not sure what to make of fixme:file:server_get_file_info. It's not part of the source code, so it is likely something in wine. Since I'm not a wine expert, all I can do is to link you to a guide. The compiler is the same for colonization and civ4, so odds are the tutorial will work for colonization too. Sure there are WTP specific parts to compiling, like the perl requirement, but if the issue is the compiler itself, then the tutorial should do the trick.

 
@Nightinggale I got that working without changing anything, so I poked around a bit more. I had to edit the Makefile and one of the headers. It might be due to something in my environment, but I'm not sure.

This might not be the minimal set of changes required as I tried a bunch of stuff before I got it working.

Spoiler diff to get build working in wine :

Diff:
diff --git a/Project Files/DLLSources/CvGlobals.h b/Project Files/DLLSources/CvGlobals.h
index d2571651..cf01e336 100644
--- a/Project Files/DLLSources/CvGlobals.h   
+++ b/Project Files/DLLSources/CvGlobals.h   
@@ -1629,8 +1629,6 @@ bool writeInfoArray(FDataStreamBase* pStream,  std::vector<T*>& array)
     return true;
 }
 
-#endif
-
 
 // inlined functions
 // The following functions are copied from CvGlobals.cpp as they are ideal candidates for inlining
@@ -2799,3 +2797,5 @@ inline int CvGlobals::getNUM_LEADERANIM_TYPES() const
 {
     return NUM_LEADERANIM_TYPES;
 }
+
+#endif
diff --git a/Project Files/Makefile b/Project Files/Makefile
index 10375469..9868e558 100644
--- a/Project Files/Makefile   
+++ b/Project Files/Makefile   
@@ -278,7 +278,7 @@ dll: all
 clean:
     @IF EXIST "$(TEMP_TARGET_FILES)" RMDIR /s /q "$(TEMP_TARGET_FILES)"
     @FOR %i IN ($(Target_BIN) $(Target_STATICLIB) $(Target_RESOURCE) \
-        $(Target_PCH) $(Target_PDB) $(Target_OTHER) "WeThePeople-*.zip" $(TEMP_FILE_DIR)"\python.timestamp") DO @IF EXIST "%i" DEL "%i"
+        $(Target_PCH) $(Target_PDB) $(Target_OTHER) "WeThePeople-*.zip" $(TEMP_FILE_DIR)"\python.timestamp") DO IF EXIST "%i" DEL "%i"
 
 build: $(Target_BIN)
 !IFDEF YOURMOD
@@ -298,12 +298,12 @@ source_list: source_list_building Make_Dir test_DllExport test_Python fastdep
 source_list_building: header_building
     @ECHO Building source list
     @ECHO SOURCES= \> $(FILE_DEPENDS)
-    @FOR %j in ($(SUBDIRS)) DO @(FOR %i IN ($(SOURCE_DIR)\%j\*.cpp) DO @ECHO %i \>> $(FILE_DEPENDS))
-    @FOR %j in ($(SUBDIRS)) DO @(FOR %i IN ($(SOURCE_DIR)\%j\*.c) DO @ECHO %i \>> $(FILE_DEPENDS))
-    @ECHO.>> $(FILE_DEPENDS)
+    @FOR %j in ($(SUBDIRS)) DO (FOR %i IN ($(SOURCE_DIR)\%j\*.cpp) DO ECHO %i \>> $(FILE_DEPENDS))
+    @FOR %l in ($(SUBDIRS)) DO (FOR %k IN ($(SOURCE_DIR)\%l\*.c) DO ECHO %k \>> $(FILE_DEPENDS))
+    @ECHO.>> $(FILE_DEPENDS)
     @ECHO OBJS= \>> $(FILE_DEPENDS)
-    @FOR %j in ($(SUBDIRS)) DO @(FOR /F "delims=." %i IN ('dir /b $(SOURCE_DIR)\%j\*.cpp') DO @ECHO. $(TEMP_TARGET_FILES)\%j\%i.obj \>> $(FILE_DEPENDS))
-    @ECHO.>> $(FILE_DEPENDS)
+    @FOR %m in ($(SUBDIRS)) DO (FOR /F "delims=." %n IN ('dir /b $(SOURCE_DIR)\%m\*.cpp') DO ECHO $(TEMP_TARGET_FILES)\%m\%n.obj \>> $(FILE_DEPENDS))
+    @ECHO.>> $(FILE_DEPENDS)
    
 header_building:
 !IFDEF NO_FASTDEP
@@ -325,19 +325,19 @@ fastdep: source_list_building
 !ENDIF
 !IFNDEF NO_FASTDEP
     @$(FD) --objectextension=pch -q --removepath=$(SOURCE_DIR)\ -O $(TEMP_TARGET_FILES) $(SOURCE_DIR)\CvGameCoreDLL.cpp >> $(FILE_DEPENDS)
-    @$(FD) --objectextension=obj -q --removepath=$(SOURCE_DIR)\ -O $(TEMP_TARGET_FILES) $(SOURCES) >> $(FILE_DEPENDS)
+    @$(FD) --objectextension=obj -q --removepath=$(SOURCE_DIR)\ -O $(TEMP_TARGET_FILES) $(SOURCES) >> $(FILE_DEPENDS)
 !ENDIF
 
 Make_Dir:
-    @FOR %j in ($(SUBDIRS)) DO @(IF NOT EXIST "$(TEMP_TARGET_FILES)\%j\." MKDIR "$(TEMP_TARGET_FILES)\%j")
+    @FOR %j in ($(SUBDIRS)) DO (IF NOT EXIST "$(TEMP_TARGET_FILES)\%j\." MKDIR "$(TEMP_TARGET_FILES)\%j")
     @IF NOT EXIST "$(TARGET)\." MKDIR $(TARGET)
 
 Target_unfinished:
-    @ECHO.>$(TEMP_TARGET_FILES)\unfinished.@
+    @ECHO . > $(TEMP_TARGET_FILES)\unfinished.@
     @FOR /F "delims=@" %i IN ('dir /b $(TEMP_TARGET_FILES)\*.@') DO \
-        @IF EXIST "$(TEMP_TARGET_FILES)\%i" DEL "$(TEMP_TARGET_FILES)\%i"
+        (IF EXIST "$(TEMP_TARGET_FILES)\%i" DEL "$(TEMP_TARGET_FILES)\%i")
     @FOR /F %i IN ('dir /b $(TEMP_TARGET_FILES)\*.@') DO \
-        @IF EXIST "$(TEMP_TARGET_FILES)\%i" DEL "$(TEMP_TARGET_FILES)\%i"
+        (IF EXIST "$(TEMP_TARGET_FILES)\%i" DEL "$(TEMP_TARGET_FILES)\%i")
 
 $(Target_BIN): $(OBJS) $(Target_RESOURCE)
     @ECHO.Linking DLL
@@ -345,95 +345,95 @@ $(Target_BIN): $(OBJS) $(Target_RESOURCE)
 
 {$(SOURCE_DIR)\.}.cpp{$(TEMP_TARGET_FILES)\.}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\.}.c{$(TEMP_TARGET_FILES)\.}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR1)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR1)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH1)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH1)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR2)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR2)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH2)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH2)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR3)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR3)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH3)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH3)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR4)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR4)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH4)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH4)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR5)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR5)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH5)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH5)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR6)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR6)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH6)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH6)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR7)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR7)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH7)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH7)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR8)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR8)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH8)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH8)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR9)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR9)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH9)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH9)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR10)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR10)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH10)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH10)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR11)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR11)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH11)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH11)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR12)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR12)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH12)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH12)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR13)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR13)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH13)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH13)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR14)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR14)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH14)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH14)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 {$(SOURCE_DIR)\$(SUBDIR15)}.cpp{$(TEMP_TARGET_FILES)\$(SUBDIR15)}.obj:
     @ECHO.>"$*.obj.@"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH15)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(SUBDIRPATH15)$(PRECOMPILE_CFLAGS2) $(INCS) /Fo$*.obj /c $<
     @DEL "$*.obj.@"
 
 
 $(Target_PCH) $(TEMP_TARGET_FILES)\_precompile.obj: $(PRECOMPILE_DEPENDENCIES)
     @ECHO.>"$(Target_PCH).@"
     @ECHO.>"$(TEMP_TARGET_FILES)\_precompile.obj.@"
-    @FOR %i IN ($(TEMP_TARGET_FILES)\*.obj) DO @IF EXIST "%i" DEL "%i"
-    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(PRECOMPILE_CFLAGS2) $(PRECOMPILE_MEMORY) $(INCS) /YcCvGameCoreDLL.h /Fo"$(TEMP_TARGET_FILES)\_precompile.obj" /c $(SOURCE_DIR)\_precompile.cpp
+    @FOR %i IN ($(TEMP_TARGET_FILES)\*.obj) DO IF EXIST "%i" DEL "%i"
+    @$(CPP) /nologo $(CFLAGS) $(PRECOMPILE_CFLAGS1)$(PRECOMPILE_CFLAGS2) $(PRECOMPILE_MEMORY) $(INCS) /YcCvGameCoreDLL.h /Fo"$(TEMP_TARGET_FILES)\_precompile.obj" /c $(SOURCE_DIR)\_precompile.cpp
     @DEL "$(Target_PCH).@"
     @DEL "$(TEMP_TARGET_FILES)\_precompile.obj.@"


Lines that don't look like they changed are replacing spaces with tabs.
 
From my brief look through, it seems like it is removing a few @. This character removes the output of the following command from STDOUT and is as such not needed in order to compile. If it causes issues, then it will be removed. The other change is apparently linux is upset with lack of spaces between command and output redirection. I don't think windows cares about that, so that one should be possible to be changed too without issues.

Thanks for reporting back.
 
Back
Top Bottom