TONPPAMF

The Official NPPAngband And NPPMoria Forum

You are not logged in.

Announcement

November 28, 2016 - NPPAngband forum has been migrated to a new host. SSL has been enabled so please use https:// if possible.

#1 2008-12-02 02:41:54

ramela
Member
From: Helsinki
Registered: 2004-10-01
Posts: 420

Borland c++ 6.0

I try to make with the makefile.bcc and I get (only) 3 errors.

[C++ Error] cmd1.c(168): E2140 Declaration is not allowed here
[C++ Error] cmd1.c(171): E2140 Declaration is not allowed here
[C++ Error] cmd1.c(174): E2140 Declaration is not allowed here

The lines are (I removed the comments in between the lines)

u32b element = cave_ff3_match(y, x, TERRAIN_MASK);

bool is_native = is_monster_native(y, x, r_ptr);
    
bool is_flying = (m_ptr->mflag & (MFLAG_FLYING)) != 0;

Above and below these declarations there are more declarations...

Any idea what the problem is.

As a quick fix, I tried separating the declarations and value assignements but that didn't help.


style7,NPPAngband.png

Offline

#2 2008-12-03 10:26:54

NPPAngband
NPPAngband Maintainer
Registered: 2004-07-01
Posts: 1,647
Website

Re: Borland c++ 6.0

The problem may not be those lines but the ones above it.  Is there any executable code (not variable declarations) right above it?

Offline

#3 2008-12-03 12:45:40

ramela
Member
From: Helsinki
Registered: 2004-10-01
Posts: 420

Re: Borland c++ 6.0

Yes, there is one line :

object_flags(o_ptr, &f1, &f2, &f3, &fn);

These lines are around line 165 in cmd1.c, in the function tot_dam_aux.

I'll try moving that line down to after the declarations, it should not break anything since those lines deal with the monster being damaged, not the item under scrutiny by object_flags.

Also, I was wrong, the other declaration were before those three lines, (and before object_flags) not after.


style7,NPPAngband.png

Offline

#4 2008-12-03 14:22:35

NPPAngband
NPPAngband Maintainer
Registered: 2004-07-01
Posts: 1,647
Website

Re: Borland c++ 6.0

That was probably it.  It should be moved down below all the declarations.  That will cause a warning with most compilers, but I guess with borland it causes an error.

Offline

#5 2008-12-04 03:47:17

ramela
Member
From: Helsinki
Registered: 2004-10-01
Posts: 420

Re: Borland c++ 6.0

So, I moved it and it stopped the errors, but then another declaration, this time in cmd2.c caused a similar error, that was not reported as an error before. After I fix that, another new declaration error crops up. mad

So f&%k Borland.

I guess I'll just install LCC on my work laptop then. (Despite it not being allowed.)


style7,NPPAngband.png

Offline

Board footer

Powered by FluxBB