The Help Thread

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

Moderators: Committer, Committer

Post Reply
Message
Author
OceanMachine
Pupating Mass
Posts: 95
Joined: Thu Jun 26, 2003 12:09 pm
Location: Chicago

The Help Thread

#1 Post by OceanMachine » Tue Jul 01, 2003 12:59 am

I figure we'll need one of these since we lost so much documentation from the other forum. This list of questions was sent to me by email today and should make good starter material:
1. I need literature for the gcc c++. What bookS would be good ?
I really can't recommend any by personal experience. A quick search turned up this reference: http://www.amazon.com/exec/obidos/tg/de ... ?vi=glance

2. I was at http://gcc.gnu.org/ , but as I looked for the windows
version, the page gave me links to cygwin and MinGW project. What shall I
do at that point ?
I'm sure our windows developers can answer this better. If you go to the downloads area of the MinGW page it has DL's for all the packages. From what I can tell it looks like you just download and run this file: http://prdownloads.sf.net/mingw/MinGW-2 ... e?download
3. The game should work on win32 and linux, but where shall I program
it. I want to program it in windows.
This game is currently being developed on both platforms, so you shouldn't have any problems in that regard.
4. I tried things with CVS, but it does not work. When I want to login
it does not work.
Can you provide some more details (paste your command and the CVS output). You haven't been added to the project yet, so if you're trying to check things out it may not work. But you shouldn't have any trouble to download the code without logging in.
5. Where can I get DevC++ ?
Go here: http://www.bloodshed.net/devcpp.html
6. My Sourceforge name is ak_trace , where can I get that ID ?
Mark will get you signed up.
7. When I have all the code. How can I compile everything to one game ?
I'm not sure how this work on windows, but in linux we have to do 3 compiles at the moment, one of the human client, one for the AI client, and one for the server..
Programming Lead

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

Re: The Help Thread

#2 Post by tsev » Tue Jul 01, 2003 11:57 am

2. I was at http://gcc.gnu.org/ , but as I looked for the windows
version, the page gave me links to cygwin and MinGW project. What shall I
do at that point ?
I'm sure our windows developers can answer this better. If you go to the downloads area of the MinGW page it has DL's for all the packages. From what I can tell it looks like you just download and run this file: http://prdownloads.sf.net/mingw/MinGW-2 ... e?download
If you're developing in windows, just download Dev-C++. It includes the version of MinGW and gcc you need. You also don't need cygwin to make FreeOrion work in windows.
7. When I have all the code. How can I compile everything to one game ?
I'm not sure how this work on windows, but in linux we have to do 3 compiles at the moment, one of the human client, one for the AI client, and one for the server..
In windows it works the same way. There are Dev-C++ dev files representing 3 separate projects in FreeOrion/client/human, FreeOrion/client/ai, and FreeOrion/server. You will need to build each of these to make it all work.
FreeOrion Programmer

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

#3 Post by trace » Tue Jul 01, 2003 12:08 pm

when I use wincvs and enter

cvs -z3 -d:pserver:[email protected]:/cvsroot/freeorion co GG

there is a message:

cvs [checkout aborted]: recv() from server cvs.sourceforge.net: EOF

and I have no SourceCode.

Question: if it works, where is the sourcecode then ?

jbarcz1
Creative Contributor
Posts: 226
Joined: Thu Jun 26, 2003 4:33 pm
Location: Baltimore, MD

#4 Post by jbarcz1 » Tue Jul 01, 2003 1:42 pm

Sourceforge has a page that tells you, step by step, how you need to set CVS set up to work in Windows. They dont allow pserver connections, and there were, as I recall, lots of hoops you had to jump through to get access (connecting to their server with ssh, using pageant, etc)

I dont have the link right now but if you look around sourceforge you might find it.
Empire Team Lead

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

#5 Post by tzlaine » Tue Jul 01, 2003 3:46 pm

trace wrote:when I use wincvs and enter

cvs -z3 -d:pserver:[email protected]:/cvsroot/freeorion co GG

there is a message:

cvs [checkout aborted]: recv() from server cvs.sourceforge.net: EOF

and I have no SourceCode.

Question: if it works, where is the sourcecode then ?
The sourcecode is in a module called FreeOrion, not GG. There is a separate module you will also need called GG, but that's in cvsroot/gigi, not cvsroot/freeorion.

And what Josh says above is not entrely correct; Sourceforge does allow pserver access.

However, you should note that checking in or out sources under Windows with anything other than WinCVS is a bad idea. Other Windows cvs versions don't handle Unix/Windows line conversions properly.

drek
Designer Emeritus
Posts: 935
Joined: Thu Jun 26, 2003 8:07 am

#6 Post by drek » Tue Jul 01, 2003 4:27 pm

I've been using TortoiseCVS to successfully check out FreeOrion using the following in the CVSroot field:

pserver:[email protected]:/cvsroot/freeorion

and the module name set to FreeOrion.

However, I sometimes get the same error message that Trace does. Waiting 20 minutes and trying again seems to work. I think maybe there's a bandwidth limit on anonymous access to the CVS, or something like that.

If I were to someday check something back in, should I use WinCVS to avoid that unix line thingy?

OceanMachine
Pupating Mass
Posts: 95
Joined: Thu Jun 26, 2003 12:09 pm
Location: Chicago

#7 Post by OceanMachine » Thu Jul 03, 2003 2:50 am

Stupid C++ question of the week....

I was not aware that if you have some function and access some object by reference as such:

void stupid_function()
{
ServerUniverse universe = server_app->Universe();
}

..when the function completes it destroys the variable. ddd got a good workout trying to figure out what the hell was happening to the universe... So I did things this way instead:

ServerUniverse* universe = &(server_app->Universe());

Is there a cleaner way of doing this, or is that pretty much how you're supposed to do it?
Programming Lead

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

#8 Post by tzlaine » Thu Jul 03, 2003 3:05 am

OceanMachine wrote:Stupid C++ question of the week....

I was not aware that if you have some function and access some object by reference as such:

void stupid_function()
{
ServerUniverse universe = server_app->Universe();
}

..when the function completes it destroys the variable. ddd got a good workout trying to figure out what the hell was happening to the universe... So I did things this way instead:

ServerUniverse* universe = &(server_app->Universe());

Is there a cleaner way of doing this, or is that pretty much how you're supposed to do it?
No. You're supposed to catch a reference in a reference:

ServerUniverse& universe = server_app->Universe();

OceanMachine
Pupating Mass
Posts: 95
Joined: Thu Jun 26, 2003 12:09 pm
Location: Chicago

#9 Post by OceanMachine » Thu Jul 03, 2003 3:26 am

<smacks head on keyboard> :x :oops:
Programming Lead

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

#10 Post by Yoghurt » Thu Jul 03, 2003 12:48 pm

trace wrote:when I use wincvs and enter

cvs -z3 -d:pserver:[email protected]:/cvsroot/freeorion co GG

there is a message:

cvs [checkout aborted]: recv() from server cvs.sourceforge.net: EOF

and I have no SourceCode.

Question: if it works, where is the sourcecode then ?
First of all, as already said, you'll use
/cvsroot/gigi for co GG and /cvsroot/freeorion for co FreeOrion (case sensitive), you'll have to do a login first, of course (for both /freeorion and /gigi)
the error-message is because the sourceforce-cvs-server is overloaded. Just try again a few minutes later. (And again, and again...)

Edited by Zach: Changed libgigi to gigi.

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

Problem with newest build - using Windows

#11 Post by tsev » Thu Jul 10, 2003 1:41 am

The newest build I have doesn't render any windows and crashes if you don't click on a button. Does anyone else have this problem who is running Windows?

I know its working in linux, and the code looks fine to me.

Edit: OK, I know something is wrong....I assume its the DLL. I literally deleted every file on my computer having to do with FreeOrion and did fresh checkouts of everything and new builds, and I still have the same problem. I was wokring perfectly until the transition to the DLL.
FreeOrion Programmer

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

Re: Problem with newest build - using Windows

#12 Post by Yoghurt » Thu Jul 10, 2003 3:09 pm

tsev wrote:The newest build I have doesn't render any windows and crashes if you don't click on a button. Does anyone else have this problem who is running Windows?
If it doesn't render windows, how can you click a button?

Maybe it has something to do with my dirty dummy-Driver hack. I fear that windows keeps only one global enviroment space.

Can you try to first load freeorion.exe, and then freeoriond.exe, please?
Or, simple comment out the getenv/putenv lines in ServerApp.cpp

Also, could you execute them from a command shell to see if the Client says something like "WARNING: you're using the dummy-videodriver".

If it does, we'll have to conditionally compile the hack into the LINUX-Server, but not into the Windows server.

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

Re: Problem with newest build - using Windows

#13 Post by tzlaine » Fri Jul 11, 2003 2:16 am

Yoghurt wrote:
tsev wrote:The newest build I have doesn't render any windows and crashes if you don't click on a button. Does anyone else have this problem who is running Windows?
If it doesn't render windows, how can you click a button?

Maybe it has something to do with my dirty dummy-Driver hack. I fear that windows keeps only one global enviroment space.

Can you try to first load freeorion.exe, and then freeoriond.exe, please?
Or, simple comment out the getenv/putenv lines in ServerApp.cpp

Also, could you execute them from a command shell to see if the Client says something like "WARNING: you're using the dummy-videodriver".

If it does, we'll have to conditionally compile the hack into the LINUX-Server, but not into the Windows server.
I haven't really looked into this yet, but it seems very unlikely that the server's choice of video driver has anything to do with the client's video.

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

#14 Post by tsev » Fri Jul 11, 2003 3:36 am

Yoghurt wrote:If it doesn't render windows, how can you click a button?
It renders the buttons, just not the window backgrounds. I'll try your suggestions tomorrow and I'll let you know what happens.
FreeOrion Programmer

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

#15 Post by tzlaine » Fri Jul 11, 2003 3:46 am

Everything should be fixed now. I think the problem was that you were using a different version of the GG headers than the version used to compile GG's libs. Please update your working copy, including GG. Don't forget to grab WindowsKit.zip/GiGi.dll and put it in your path, and grab WindowsKit.zip/Copy-to-Dev-Cpp/libGiGi.a and put in your Dev-Cpp/lib directory.

Linux users who are reading this just need to update, make, and make install GG.

Post Reply