You are not logged in.

#1 2010-06-13 11:55:38

thom_raindog
Member
Registered: 2008-04-29
Posts: 175

Help with errors during compilation

Hello,

it's me again, the programming illiterate that needs to compile things wink

I need to get this pbem host to compile: http://www.prankster.com/project/downlo … _4_0_4.tgz

Right off the bat it throws this error:

make                                                                                               
g++ -g -I. -I.. -c -o obj/extra.o extra.cpp                                                                                                           
In file included from ../gameio.h:28:0,                                                                                                               
                 from ../aregion.h:32,                                                                                                                
                 from ../game.h:30,                                                                                                                   
                 from extra.cpp:28:                                                                                                                   
../astring.h:28:22: fatal error: iostream.h: No such file or directory                                                                                
compilation terminated.                                                                                                                               
make: *** [obj/extra.o] Error 1

which I was able to work around by changing the reference to iostream.h to iostream in astring.h

But after doing this I get:

make                                                                                       
g++ -g -I. -I.. -c -o obj/extra.o extra.cpp                                                                                                           
In file included from ../gameio.h:28:0,                                                                                                               
                 from ../aregion.h:32,                                                                                                                
                 from ../game.h:30,                                                                                                                   
                 from extra.cpp:28:                                                                                                                   
../astring.h:32:12: error: 'ostream' does not name a type                                                                                             
../astring.h:33:12: error: 'istream' does not name a type                                                                                             
In file included from ../game.h:30:0,                                                                                                                 
                 from extra.cpp:28:                                                                                                                   
../aregion.h:211:28: error: 'ARegionArray' has not been declared                                                                                      
extra.cpp: In member function 'void Game::PostProcessUnitExtra(ARegion*, Unit*)':                                                                     
extra.cpp:133:43: warning: deprecated conversion from string constant to 'char*'                                                                      
extra.cpp:167:53: warning: deprec

and that goes well beyond me to even attempt trial&error to get past...

Any coders out there able to point me in the right direction?

Offline

#2 2010-06-13 17:10:55

saline
Member
Registered: 2010-02-20
Posts: 86

Re: Help with errors during compilation

This code is pre <header.h> to <header>-with-namespace change.  astring.h needs one of the following:
a 'using  namespace std;' near the top;
a set of 'using x;' at the top where x is ostream, istream and other classes in std; or
ostream, istream and other classes in std must be prefixed with 'std::'

This may help:
http://www.glenmccl.com/ns_comp.htm

Offline

#3 2010-06-14 20:07:48

thom_raindog
Member
Registered: 2008-04-29
Posts: 175

Re: Help with errors during compilation

I found someone who fixed-hacked it to compile on my machine, thank you smile

Offline

#4 2010-06-15 00:55:45

JohnVV
Member
From: Ann Arbor, Mi. U.S.A.
Registered: 2009-09-30
Posts: 107
Website

Re: Help with errors during compilation

it works , good
for reference here is the gcc porting guide -- there have been a lot of changes.
gcc 4.0 to gcc 4.3
http://gcc.gnu.org/gcc-4.3/porting_to.html
gcc 4.3 to gcc 4.4
http://gcc.gnu.org/gcc-4.4/porting_to.html

Offline

Board footer

Powered by FluxBB