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: Compiling with Dev C++ 4.9.8.0
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
E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:34
  Old Post 11-06-2005 09:38 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
PROJECT: Compiling with Dev C++ 4.9.8.0 Support Apolyton, buy Civilization III: Complete

quote:
Originally posted by Martin Gühmann


No need for a main.cpp. If you have have installed some "demo" version of MS VC++ (and not VBasic as you told me) then you just need to double click on the file civctp.dsw and the Visual Studio opens this project file. And then you can use the IDE to edit the files and of course to compile and link the files.

Of course to compile and link the files you need DirectX installed.

-Martin


Dev C++ 4.9.8.0

Ok, I'm giving it a shot. Big note this is the first time I've compiled a C++ program, Turbo Pascal back n 1994 was the last time I've compiled something so there maybe some real basic questions and confusion so bear with me.

First attempt:
Opened with civctp.dsw with DevC++ and hit execute->compile figured to strt with te basics.

Results: of course that didn't work.

Second attempt: Okay I started a new project in DevC++ and as I went to add files to it appears I can't select a folder and add all those files, instead I have to go into each folder and add files. Not sure if this will mess up the directories etc. But with 1000+ code files I think this may take TOO long so I'm looking for another way.

Last edited by E on 11-06-2005 at 09:47

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:34
  Old Post 11-06-2005 09:58 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Help yourself to an AD-FREE life

Okay in my second attempt I started with adding all the files in the ctp2_code/ai folder and just to lear how the compiler works I tried to just compile that folder. I know it shouldn't make an exe but I wanted to see how it compiled and how the log is generated and I got 437 errors I posted the log in the attched text. Before I go crazy I'm hoping you coder guys can help explain:

a faster way to add all the files
if not, does nt have folders hurt?

and please let me know if find anything of value in my error log.

thanks!

Attachment: compile log1 - ai.txt
This has been downloaded 4 time(s).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:34
Post  Old Post 12-06-2005 04:15 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

Well I tried Dev C++ 4.9.8.2. When I tried to import the civctp.dsp file I got an crash, but I was able to import dbgen sucessfully. The first one was about ctp2_config.h. Error meassage:

Unsupported build environment.

However I think on windows the content of config_win32.h should be ok. So I included it into the else block of ctp2_config.h for testing purposes.

However another observation is that there is no config.h. So that the code doesn't compile if HAVE_CONFIG_H is defined.

After that I got problems with these two lines:

typedef signed __int64 sint64;
typedef unsigned __int64 uint64;

The best is I think that we get rid of them entirely. Afterwards I outcommented them dbgen was compiled. No problem.

However it is not a good idea to rebuilt the project file from scratch E. First it is a lot of work and second it doesn't work, because of such MS specific stuff. I think this sint64 stuff can be removed easily as it isn't used used (I hope), but there is more stuff that we have to consider.

-Martin

ctplinuxfan is offline ctplinuxfan
Warlord

Jan 2004
time: 06:34
  Old Post 12-06-2005 16:16
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by Martin Gühmann
Well I tried Dev C++ 4.9.8.2. When I tried to import the civctp.dsp file I got an crash, but I was able to import dbgen sucessfully. The first one was about ctp2_config.h. Error meassage:

Unsupported build environment.

However I think on windows the content of config_win32.h should be ok. So I included it into the else block of ctp2_config.h for testing purposes.

However another observation is that there is no config.h. So that the code doesn't compile if HAVE_CONFIG_H is defined.

HAVE_CONFIG_H is a define by gnu autotools when you create a config.h with autoheader. For windows, config_win32.h should be fine and HAVE_CONFIG_H should not be used, unless you are using autotools for compilation.

quote:

typedef signed __int64 sint64;
typedef unsigned __int64 uint64;


The int64 types are used quite some times, e.g. for improvements (citydata.cpp, serialisation etc.). So they are used and i remember some cases where i had to append ULL to large constants to make gcc recognize them as 64bit integers. I don't know DevC++, but it says it uses the GNUCC, so chances are great you have a stdint.h header in system include path.

Revert your changes and try changing ctp2_code/os/include/ctp2_inttypes.h that way:

code:
#if defined(WIN32) to #if defined(_MSC_VER)


I intended this first, but thought maybe other win32 compilers could use the same config again, so WIN32 is in the ifdef.

In config_win32.h, append the following:
code:
#if defined(__GNUC__) && !defined(HAVE_STDINT_H) #define HAVE_STDINT_H 1 #endif #if defined(__GNUC__) && !defined(HAVE_INTTYPES_H) #define HAVE_INTTYPES_H 1 #endif


If this works, commit. :-)

quote:

The best is I think that we get rid of them entirely. Afterwards I outcommented them dbgen was compiled. No problem.

However it is not a good idea to rebuilt the project file from scratch E. First it is a lot of work and second it doesn't work, because of such MS specific stuff. I think this sint64 stuff can be removed easily as it isn't used used (I hope), but there is more stuff that we have to consider.
-Martin

Well, that's exactly what's done for the linux port, but it uses GNU autoconf, automake and libtool. So theoretically, you could start with cygwin trying to compile it.
However I think Mingw32 does not include these packages, so for other compilers (borland c++, mingw32, openwatcom, etc.) you need specific makefiles.

[edit:] HAVE_CONFIG_H will be defined if you use Cygwin with gcc and libtool installed and run ./autogen.sh ; ./configure ; make sequence.

Last edited by ctplinuxfan on 12-06-2005 at 17:52

ctplinuxfan is offline ctplinuxfan
Warlord

Jan 2004
time: 06:34
  Old Post 12-06-2005 19:46
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Put an end to popups!

quote:
Originally posted by E
Okay in my second attempt I started with adding all the files in the ctp2_code/ai folder and just to lear how the compiler works I tried to just compile that folder. I know it shouldn't make an exe but I wanted to see how it compiled and how the log is generated and I got 437 errors I posted the log in the attched text. Before I go crazy I'm hoping you coder guys can help explain:

a faster way to add all the files
if not, does nt have folders hurt?

and please let me know if find anything of value in my error log.

thanks!

You can checkout branches/linux and look in the Makefile.am files. They contain the sourcesfiles excerpted of the civctp.dsp Project relative to the directory where the Makefile.am you view is located. If you add all these by copy and paste and fix leading pathes, you should have all files of the project.

In ctp2_code/os/autoconf/Makefile.common is a Makefile for inclusion which contains common flags which will be used by the Makefile.am later on.

You could put something like this into your Makefile (_LDFLAGS still need the .lib files to be linked against)

code:
# relative or absolute path to the ctp2_code directory of the source code ctp2_code=C:/ctp2_source/ctp2_code include $(ctp2_code)/os/win32/Makefile.config


with a Makefile.config like this:
code:
# Change as needed DIRECTX_SDKDIR=C:/DX70SDK DXMEDIA_SDKDIR=C:/DXMEDIA # Hopefully need no changes here except adding the libs needed DIRECTX_INCLUDES=$(DIRECTX_SDKDIR)/Include DIRECTX_LDFLAGS=-L$(DIRECTX_SDKDIR)/libs DXMEDIA_INCLUDES=$(DXMEDIA_SDKDIR)/Include DXMEDIA_LDFLAGS=-L$(DXMEDIA_SDKDIR)/libs include $(ctp2_code)/os/autoconf/Makefile.common CPPFLAGS=$(CTP2_CPPFLAGS) CFLAGS=-fms-extensions $(CTP2_CPPFLAGS) $(CTP2_CFLAGS) CXXFLAGS=-fms-extensions $(CTP2_CPPFLAGS) $(CTP2_CXXFLAGS) LDFLAGS=$(CTP2_LDFLAGS)


I don't know how mingw32 handles file seperators, perhaps you need to replace slashes (/) with backslashes (\) or even with two backslashes (\\). At least this should reduce the file not found errors to somewhat at 0...

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:34.
Apolyton Time is 00:34.
    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.0312 seconds (84.91% PHP - 15.09% 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