Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Call To Power II > CtP2-Source Code Project > PROJECT-> C++ Compiler: Which one?
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
CivGroups
CTP2 Source Code Project (59): Not a Member - Join

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Keygen is offline Keygen
Emperor
Athens, Hellas
Jan 2000
time: 07:31
  Old Post 07-11-2003 01:37 Visit Keygen's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
PROJECT-> C++ Compiler: Which one? Lose 30 kilos (of popups)

Suggest a C++ Compiler that should be used as the default one for compiling the source code and any changes made in it.

Please, only post if you are a programmer, professional or amateur, have a knowledge of C++ and have used a C++ Compiler before.

The original code was compiled with Microsoft Visual C++ 6.0. As far as I know it is unknown on what Service Pack, if any.

The trend right know are the Microsoft Visual C++ 6.0 and Visual C++ .NET and in a first look that would seem like the best solution to secure as much compatibility and less problems as possible.

A good idea would be a free compiler also, ANSI compliant, so that future porting to different operating systems be easier, or possible for programmers that don't have access to Microsoft Visual C++ or don't won't to work on it.

Note that we must decide on a common accepted compiler as if we start compiling in different compilers, each one on his/her own, could lead to incompatibilities and additional work and work arounds.

Related threads:

Getting the source to compile
Getting the source to compile on VS.NET
Tools for documentation and development
compiler program
Linux Port

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:31
  Old Post 07-11-2003 01:46 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Enter the AD-FREE zone

There are two decent options, IMO. One is Visual C++ 6. The big upside is that it's what was originally used for development, and that we have succeeded in compiling the game with it, and getting it to run. .NET does provide some neat stuff, but it seems that a lot of additional work needs to be done to port the source into it. Seeing how Visual C++ .NET costs a lot of money, just like version 6, it's not our priority, I think. This does, though, leave the people with .NET only in a bad state somewhat.

gcc is a good choice. It is, after all, a free compiler, and a pretty decent one. It does even understand some code that might have been written with Visual C++ in mind, code that other compilers wouldn't understand. But again, our coders would have to do a fair amount of work to configure the makefile and figure out how to get the source to compile under gcc.

Provided that porting to gcc can be done within a reasonable timeframe, it could be a very solid option, mainly because of the compiler's availability.

Keygen is offline Keygen
Emperor
Athens, Hellas
Jan 2000
time: 07:31
  Old Post 07-11-2003 01:52 Visit Keygen's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

Please, include a description and the reasoning behind your suggestion, and link(s) to the developer/service, if any.

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:31
  Old Post 07-11-2003 01:56 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Full PM-box? Change here!

GCC Compiler Page

Microsoft Visual Studio

Recommended site about .NET

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:31
  Old Post 07-11-2003 02:05 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton or Terrorists Win

Why choose? I'd say let's make it work with as many compilers as possible (using #ifdefs where needed) and just use whichever one we prefer...

Keygen is offline Keygen
Emperor
Athens, Hellas
Jan 2000
time: 07:31
  Old Post 07-11-2003 02:07 Visit Keygen's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

In my opinion it should be a priority to decide on a common accepted compiler. How much time it will take is secondary right now as long as it is not off limit. It could save surprises and much more time in the future. Besides the more you work on making the code compile the more you'll get familiar with it.

MrBaggins is offline MrBaggins
King

May 1999
time: 05:31
  Old Post 07-11-2003 02:09
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Increase the size of your Attachments

I'd recommend Visual Studio 6.

1) Because I have it
2) Because I don't need .NET, and don't have any plans to buy it, without a more concrete reason than game debugging
3) Because we know it was used to develop CTP2, plus it works
4) Because time spent porting to other compilers could be time spent working on this.

I don't see why one group of [strike]zealots[/strike] programmers could work on porting it to gcc.. especially with a view to getting it to port to linux. The same goes for VS.Net (although I think this will be an easier task)

Keygen is offline Keygen
Emperor
Athens, Hellas
Jan 2000
time: 07:31
  Old Post 07-11-2003 02:10 Visit Keygen's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Get a bigger avatar today!

Locutus, anyone is welcomed to make the code compile to as many compilers available out there as possible but when we will actually start fixing the bugs and after that improve the code and add new features as a team we will surely need to use the same compiler. The sooner we start this discussion the better.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:31
  Old Post 07-11-2003 02:12 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Help yourself to an AD-FREE life

What do you want to do? If you choose .NET, everyone will just have to shell out for a $100 copy of the software or get out of the project? If you choose a single compiler, it'll have to be freeware, basically only leaving gcc (and porting to gcc may not be trivial, which could mean we'd only be stuck trying to get the game to run for even longer than we already have).

With a few #ifdefs everyone, regardless of what compiler they have, can contribute to the project -- I don't anticipate that this would cause a lot of problems.

Last edited by Locutus on 07-11-2003 at 02:23

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:31
  Old Post 07-11-2003 02:16 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

As MrBaggins says, fixing bugs and porting to other compilers/platforms can happen simultaneously -- that's what we're doing now.

Leland is offline Leland
Prince

Jan 2000
time: 07:31
  Old Post 07-11-2003 02:22
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Increase the size of your Attachments

I can see two ways to support both systems...

1) Make sure that the code compiles on both gcc and vc++ even though it's a pain. Make official releases in whichever is faster or smaller. Note that the object code produced by one compiler is not compatible with another, so for example dll's cannot be swapped between the two builds.

2) Support only gcc but provide a workspace and a gnu compilation tools so that MS fanboys can use their own IDE. This would be nice, but who's going to do it? Gnu-users usually care little about VC++ and vice versa. And microsoft is not particularly famous for cross-compilation.

MrBaggins is offline MrBaggins
King

May 1999
time: 05:31
  Old Post 07-11-2003 02:33
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

OK... someone familiar with gcc and SDL correct me if I'm wrong.

Currently the DirectX stuff works on Visual C++/Net. Its not directly usable under Linux, (I.E. not directly emulated?)

The conversion process for that to SDL isn't instant. Its going to take some significant amount of work, delaying the beginning of real work on fixing it.

The game state is separate from the UI.

Visual Studio users could actually get to work, getting the game state to a proper place.

When the gcc/linux team had gotten to the point of everything running, they could incorporate the changes that had been made on gamestate, and start work on their own.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:31
  Old Post 07-11-2003 02:39 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Help yourself to an AD-FREE life

MrBaggins,
Yeah, basically you're correct and I agree with you.

One thing though: There's also a gcc for windows, and I *think* that that version does support DirectX, but I have zero experience with that and I doubt many others here do. It may well still involve a good deal of work to get the code working on gcc for win. So I agree we should get the Visual Studio (.NET and 6.0) team to just start working, and incorporate any changes made later.

Keygen is offline Keygen
Emperor
Athens, Hellas
Jan 2000
time: 07:31
  Old Post 07-11-2003 02:53 Visit Keygen's homepage!
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

Locutus, it is not what I want. I'm not even sure if I get involved with programming the code at all. It is what programmers, that will join the team, want. You want to work on two compilers? If that is functional and will not cause problems in the future that would be fine I guess. I'm quite curious though what will happen when we will actually start adding or making improvements in the code. Or when we'll make a package for download with several files compiled in different compilers.

If the adjustments from compiler to compiler are minor and easy to make we can fix this by assigning a programmer lead who will make the adjustment in the compiler he/she uses in any file contributed and compiled in a different compiler, recompile and pack it ready for download.

Regardless of that please continue suggesting compilers.

Last edited by Keygen on 07-11-2003 at 03:01

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:31
  Old Post 07-11-2003 03:16 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
I'm quite curious though what will happen when we will actually start adding or making improvements in the code.


Most of the changes we'll make will be in the core of the game engine: stuff that affects the cities, units, etc. Most/all of that stuff should all be platform independent and work just as easily on a Mac as on gcc for Windows as on Visual Studio .NET.

quote:
Or when we'll make a package for download with several files compiled in different compilers.


We won't. Whoever is the one to put out the package will use his own compiler to build all files. In executable form, noone should have problems running the game, as long as all EXE and DLL files were compiled with the same compiler. Of course, different people may end up releasing different versions of the game, so various versions may not be compatible with each other, but this is to be expected anyway.

DDowell is offline DDowell
Chieftain
Västerĺs, Sweden
Nov 2001
time: 06:31
  Old Post 07-11-2003 03:25
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Help yourself to an AD-FREE life

I'm all for keygen's idea. We should decide on one primary compiler and all released source files from apolyton should be able to compile on it.

I suggest we use VC++ since
-it is a more widespread compiler than the .NET version
-the original game was compiled on it.
-it actually compiles for a number of persons (myself included).

But the people with .NET will probably have another view on this

Fromafar is offline Fromafar
Prince

May 2003
time: 06:31
  Old Post 07-11-2003 03:37
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Inflate your Upload Space

gcc for Windows

Did start with this one and managed to create some DLLs from the source in the mapgen directory. Haven't tested if these actually work, because I wanted to get an overview first. Without a suitable IDE this will be quite difficult.

closms is offline closms
Settler

Nov 2003
time: 22:31
  Old Post 07-11-2003 03:42 Visit closms's homepage!
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Support Apolyton or Terrorists Win

One thing to keep in mind is that us linux folks are going to get this so g++ can compile it regardless, so perhaps this discussion is a non-issue.

Yes, getting it to compile on g++ will take a lot of work.

Have the windows programmers used cygwin?

http://www.cygwin.com/

If you don't have msdev, check it out. Even if you do have msdev, cygwin has all the tools we have on linux, bash, sed, grep, awk, patch, diff, g++ and make. You can get cvs through the cygwin package system too.

Keygen is offline Keygen
Emperor
Athens, Hellas
Jan 2000
time: 07:31
  Old Post 07-11-2003 04:23 Visit Keygen's homepage!
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

I thought it was somehow obvious but I guess I made a mistake.

It is natural and inevitable to some point that several people either from Apolyton or from every other place would sooner or later download the code and make their changes to it. I don't suggest to control that or even do anything to limit it. Actually it is more than welcomed.

My intention was toward the team that will be formed here, in these threads and will work together.

Apolyton is the entry point currently for finding the source code and usuful information. Discussions will continue taking place between people interested in modifying the code whether they will be in a team or on their own. And it will remain that way. But on the same time we can, and we should form a team, organize somehow the way it will work and perhaps put some rules as well.

I question myself and everybody here. Wouldn't be better this team to have a primary compiler?

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:31
  Old Post 07-11-2003 19:32 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#20 Report this post to a moderator
Support Apolyton buy from Amazon

If a single compiler is wanted, then it has to be gcc. It should be possible to make it work under both cygwin and linux compiled from gcc relatively easily once either one of these has been achieved.

Personally, I would rather stick with VC++ 6 for primarily selfish reasons. I have this, and I have the code compiling without any notable problems on it. As Locutus said, the vast majority of changes which are intended to fix/enhance the game will not conflict with changes to expand or alter the compiler options. The notable exception here would probably be interface design, which may not be implemented in such a way to make this easy (due to it using DirectX calls). We should, however, be able to alter things so that it is implemented in a nice way.

What I would really like to do is port the entire game to a more modern language like C# which will compile under the MS .NET compiler (which is available free, and seperate free IDEs are also available (http://www.icsharpcode.net)) or under the Mono compiler in a linux environment (http://go-mono.com). However, this is hopelessly impractical since it would involve rewriting the entire game, and it would probably be better to write a new game inspired by CTP2, which would not be restrained by the EULA. I can still dream, though .

uppi is offline uppi
Settler

Oct 2003
time: 05:31
  Old Post 07-11-2003 20:47
Edit/Delete Message Reply w/Quote
#21 Report this post to a moderator
Support Apolyton buy from Amazon

Well, as I dont have windows on my machine, my only options is to try it with gcc. I already got some files compiled, but the problem is, that there quite some sloppy code, accepted by vc++, but not by g++.

I am currently trying to compile civ_main.cpp and i am getting LOTS of errors (I had to double my console buffer so that the first errors can still be seen.

[EDIT] Oh, and by the way, not everything can be made with #ifdef, because some code needs to be moved around, because of circular dependencies.

Last edited by uppi on 07-11-2003 at 21:27

LDiCesare is offline LDiCesare
King
La Ferté sous Jouarre France
Jan 2001
time: 05:31
  Old Post 07-11-2003 23:50
Edit/Delete Message Reply w/Quote
#22 Report this post to a moderator
Inflate your Upload Space

I would probably do some debugging if I could get the code to compile on a free compiler (read gcc) under windows. I will definitely never buy MSDev C++ at home, nor .NET.

kaan is offline kaan
Prince
Aarhus
Mar 2001
time: 05:31
  Old Post 08-11-2003 00:18
Edit/Delete Message Reply w/Quote
#23 Report this post to a moderator
Support Apolyton buy from Amazon

I would much prefer to use GCC but i will support starting up with VC++ 6 to get things going.

Pyaray is offline Pyaray
Warlord
Santa Ana, CA, USA
Oct 2000
time: 21:31
  Old Post 08-11-2003 00:40 Visit Pyaray's homepage!
Edit/Delete Message Reply w/Quote
#24 Report this post to a moderator
Full PM-box? Change here!

My opinion is that you'll never get everyone to agree on a standard. You'll have the best luck (for now) with Visual C++ 6.0, simply because that's what we used to write it in the first place. The people who want to use GCC or .net will be motivated to fix up the code to work for them. And hopefully, do it in a way that doesn't break the others, so that after time it becomes a cross compiler project.

But trying to enforce any standard other than GCC is kinda far fetched, because people aren't going to spend hundreds (or for the "pro" version, thousands) of dollars to work on this. At the same time, trying to standardize on GCC would take weeks of effort to just get everything working "right", time that could be spent focusing on other things.

Pyaray

Keygen is offline Keygen
Emperor
Athens, Hellas
Jan 2000
time: 07:31
  Old Post 08-11-2003 01:01 Visit Keygen's homepage!
Edit/Delete Message Reply w/Quote
#25 Report this post to a moderator
Full PM-box? Change here!

That is true Pyaray. That is actually the conclusion I tend to come to after I have read all posts here and the progress that has already been done in different compilers. I am currently working on a solution to merge this two, the use of a standard compiler and the use of different compilers.

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:31
  Old Post 08-11-2003 01:08 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#26 Report this post to a moderator
Full PM-box? Change here!

Locutus said what seems to be the best solution... it's the #ifdef directives. I only have to hope that there wouldn't be too many differences between the VC and GCC code.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:31
  Old Post 08-11-2003 02:46 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#27 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

quote:
Originally posted by uppi
[EDIT] Oh, and by the way, not everything can be made with #ifdef, because some code needs to be moved around, because of circular dependencies.


Surely you can still handle that with #ifdefs, you just need to have two copies of the code that moves around (or you could make it a macro to avoid code duplications...)

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:31.
Apolyton Time is 00:31.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0619 seconds (92.88% PHP - 7.12% MySQL) with 36 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net