how to compile in windows

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
trace
Space Squid
Posts: 66
Joined: Fri Jun 27, 2003 6:23 pm
Location: Milkyway

how to compile in windows

#1 Post by trace »

Hi I want to compile freeorion in windows and want to know how. I downloaded DevC++ and cygwin. What shall I do ?

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

#2 Post by tzlaine »

Read the README.txt in WindowsKit.zip.

tsev
Space Kraken
Posts: 167
Joined: Thu Jun 26, 2003 2:17 pm
Location: Pittsburgh, PA

#3 Post by tsev »

cygwin isn't necessary either, though use it if you're more comfortable with *nix

elfstone
Space Squid
Posts: 78
Joined: Fri Jun 27, 2003 9:00 am
Location: Germany

#4 Post by elfstone »

I need some help compiling in windows too...

First, some problems i already solved:

1. CVS Server says EOF or error code 1 or something similiar and doesnt do anything: Means its full.. you have to login till you get an code 0 as answer, then try to co the files till you get them.
2. If your files arent in c:\ you have to change the include-paths in dev-cpp

My problem is:
While compiling the server.dev he stops in ServerApp.cpp andin line 459 and says 'setenv' undeclared (first use this function)

I did a fulltextsearch on everything i have, but this function is declared nowhere, so its not a missing include or something. Could someone tell me, in which file this function should be declared and where i can get this file.

Thx

mr_ed
Space Squid
Posts: 82
Joined: Thu Jun 26, 2003 1:13 pm
Location: Ottawa

#5 Post by mr_ed »

Which version of Windows are you running? 98?

I don't think 98 supports environment variables... I know that NT, 2000, and XP do.

Anyway... setenv should be in stdlib.h.

Yoghurt
Programmer
Posts: 376
Joined: Sat Jun 28, 2003 8:17 pm
Location: Heidelberg, Germany

#6 Post by Yoghurt »

Whoops!

Win98 does not apper to have setenv, it has putenv instead.

I modified ServerApp.cpp to use SDL's getenv and putenv, should work now.

BTW: The patch seems to be so huge because somebody forgot to turn Unix-linebreaks an, and my Editor automatically removes them

EDIT: Till the new revision is available on the backup CVS-server, here are the lines that have changed:

line 14:replace

Code: Select all

#include <stdlib.h>
with

Code: Select all

#include <SDL/SDL_getenv.h>
in SDLInit, replace

Code: Select all

setenv("SDL_VIDEODRIVER","dummy",0)
with

Code: Select all

if (getenv("SDL_VIDEODRIVER") == NULL) {
  putenv("SDL_VIDEODRIVER=dummy");
}

elfstone
Space Squid
Posts: 78
Joined: Fri Jun 27, 2003 9:00 am
Location: Germany

#7 Post by elfstone »

Im using win-xp.

Strange, why didnt anyone else had problems compiling then? Is everybody using linux here? Should i be ashamed?

Have i found a bug? May i be proud?

And thx for the help, i will try tomorrow in the morning

Tyreth
FreeOrion Lead Emeritus
Posts: 885
Joined: Thu Jun 26, 2003 6:23 am
Location: Australia

#8 Post by Tyreth »

This may not show up on the public server straight away elfstone, so don't be surprised if you update your copy and you don't get the change. The only solution is to wait until it's there - a maximum of 24 hours from when it was committed.

elfstone
Space Squid
Posts: 78
Joined: Fri Jun 27, 2003 9:00 am
Location: Germany

#9 Post by elfstone »

Now i get an error in message.cpp in the where zlib.h is included. I searched my harddisk again, and found no zlib.h, neither in dev-cpp nor in freeorion. Where do i get the right version of this file, and is it part of a package i will miss later?

Thx..

drekmonger
Space Kraken
Posts: 146
Joined: Mon Jul 07, 2003 10:17 am

zlib

#10 Post by drekmonger »

The actual library is in the windows kit. I had to download the .h file seprately here http://www.gzip.org/zlib/ and stick it into my includes directory.

elfstone
Space Squid
Posts: 78
Joined: Fri Jun 27, 2003 9:00 am
Location: Germany

#11 Post by elfstone »

okay, i downloaded zlib, made an directory c:\dev-cpp\include\zlib\ put all the files in there, and included it in my project-file. The server now compiled without errors, when i start him, i get some debuginfos, then he waits. How can i exit the server?


Now, when i try and compile the humanclient, i get those errors, and 300 others afterwards...

Compiler: Default compiler
Building Makefile: "C:\freeorion\client\human\Makefile.win"
Executing make...
make.exe -f "C:\freeorion\client\human\Makefile.win" all
g++.exe -D__DEBUG__ -c chmain.cpp -o ../../objs/chmain.o -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include/SDL" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/freeorion/boost_1_30_0" -I"C:/Dev-Cpp/include/freetype2" -I"C:/freeorion/Expat-1.95.5/Source/lib" -I"../../GG/include" -I"../../GG/include/net" -I"../../GG/include/dialogs" -I"c:/dev-cpp/include" -DFREEORION_WIN32 -DFREEORION_BUILD_HUMAN -g3

In file included from C:/Dev-Cpp/include/freetype2/freetype/freetype.h:41,
from ../../GG/include/GGText.h:35,
from ../../GG/include/GGApp.h:35,
from C:/Dev-Cpp/include/SDLGGApp.h:43,
from HumanClientApp.h:6,
from chmain.cpp:1:
C:/Dev-Cpp/include/ft2build.h:1:3: invalid preprocessing directive #Doxyfile
C:/Dev-Cpp/include/ft2build.h:3:2: invalid preprocessing directive #--
C:/Dev-Cpp/include/ft2build.h:4:3: invalid preprocessing directive #General
C:/Dev-Cpp/include/ft2build.h:5:2: invalid preprocessing directive #--
In file included from C:/Dev-Cpp/include/freetype2/freetype/freetype.h:41,
from ../../GG/include/GGText.h:35,
from ../../GG/include/GGApp.h:35,
from C:/Dev-Cpp/include/SDLGGApp.h:43,
from HumanClientApp.h:6,
from chmain.cpp:1:
C:/Dev-Cpp/include/ft2build.h:6: ISO C++ forbids de claration of `PROJECT_NAME'




The file ft2build.h is in my c:\dev-cpp\include directory, but it looks like a doxy-configuration file, not like a header file. What am i doing wrong this time?

trace
Space Squid
Posts: 66
Joined: Fri Jun 27, 2003 6:23 pm
Location: Milkyway

#12 Post by trace »

I have also problems with compiling in Windows.
First I had to fill in include directories at Projekt Options.
Second I had errors:
at server:

\Dev-Cpp\Bin\..\lib\gcc-lib\mingw32\3.2\..\..\..\..\mingw32\bin\ld.exe C:\freeorion\server\C
cannot find -lboost_signals

C:\freeorion\server\Makefile.win
[Build Error] [../freeoriond.exe] Error 1


at humanclient:
../../objs/ServerConnectWnd.o C:\Dev-Cpp\mingw32\bin\ld.exe
[Warning] duplicate section `.data$_ZTV16ServerConnectWnd' has different size

\Dev-Cpp\Bin\..\lib\gcc-lib\mingw32\3.2\..\..\..\..\mingw32\bin\ld.exe C:\freeorion\client\human\C
cannot find -lSDL_mixer

C:\freeorion\client\human\Makefile.win
[Build Error] [../../freeorion.exe] Error 1

----------------------
I have to say that most people want to play that game in Windows so I guess it should be compilable.

Yoghurt
Programmer
Posts: 376
Joined: Sat Jun 28, 2003 8:17 pm
Location: Heidelberg, Germany

#13 Post by Yoghurt »

Did you correctly copy the files from WindowsKit.zip into the DevCpp directory and the WindowsKit DLLs into the root-directory of FreeOrion?

elfstone
Space Squid
Posts: 78
Joined: Fri Jun 27, 2003 9:00 am
Location: Germany

#14 Post by elfstone »

Yes.
And i had to change some of the includedirectories, since i didnt install it in c:\boost\ but c:\freeorion\boost etc.
He's not complaining that he cant find a file, but there is a file included, that does not contain c++ but a skript for the doxyfile imho.

trace
Space Squid
Posts: 66
Joined: Fri Jun 27, 2003 6:23 pm
Location: Milkyway

#15 Post by trace »

I could compile everything now.

The problem is, that when I begin a game no server is found, I tried every server. :?

I guess that the execute I should choose is the humanclient. I guess the humanclient works together with the both other execute-files. Or what shall I do with these other both ? :? :shock:

Locked