Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old April 12, 2009, 21:55   #1
PaulBlay
Knight
 
Join Date: Jan 2009
Posts: 657
PaulBlay is on a distinguished road
r1353 compile errors

object/identify.c(166) : error C2275: 'u32b' : illegal use of this type as an ex
pression
c:\rl\angband311\src\h-basic.h(223) : see declaration of 'u32b'
object/identify.c(166) : error C2146: syntax error : missing ';' before identifier 'curses'
object/identify.c(166) : error C2065: 'curses' : undeclared identifier
object/identify.c(169) : error C2065: 'curses' : undeclared identifier
object/identify.c(173) : error C2065: 'curses' : undeclared identifier

You need to change object_notice_curses as follows.

Code:
bool object_notice_curses(object_type *o_ptr)
{
        u32b f[OBJ_FLAG_N];
        u32b curses;
        object_flags(o_ptr, f);
        curses = (f[2] & TR2_CURSE_MASK);
        
        /* Know whatever curse flags there are to know */
        o_ptr->known_flags[2] |= curses;

        p_ptr->notice |= PN_SQUELCH;

        return (curses ? TRUE : FALSE);
}
__________________
Currently turning (Angband) Japanese.
PaulBlay is offline   Reply With Quote
Old April 12, 2009, 22:10   #2
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,736
Donated: $40
Pete Mack is on a distinguished road
Surely, surely, we can move to C99 by now, after a whole decade? The only file that enforces c90 is Makefile.win. Everything else assumes the default. (Which is C99 for most compilers...)

I even checked Open Watcom, and it has support for mixed code and declaration in partial c99 compliance, using -za99 compiler flag.
Pete Mack is offline   Reply With Quote
Old April 12, 2009, 22:29   #3
PaulBlay
Knight
 
Join Date: Jan 2009
Posts: 657
PaulBlay is on a distinguished road
I also get the following error when using VC++ Command Prompt with Makefile.nmake.

debug.o : warning LNK4217: locally defined symbol __iob imported in function _to_stderr
z-util.o : warning LNK4049: locally defined symbol __iob imported
cave.o : error LNK2019: unresolved external symbol __alloca referenced in function _display_map
score.o : error LNK2001: unresolved external symbol __alloca
Angband.exe : fatal error LNK1120: 1 unresolved externals
__________________
Currently turning (Angband) Japanese.
PaulBlay is offline   Reply With Quote
Old April 12, 2009, 22:39   #4
PaulBlay
Knight
 
Join Date: Jan 2009
Posts: 657
PaulBlay is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
The only file that enforces c90 is Makefile.win.
And Makefile.nmake apparently.

In r1354

Code:
void object_notice_flag(int flagset, u32b flag)
{
        int i;

        for (i = INVEN_WIELD; i < INVEN_TOTAL; i++)
        {
                object_type *o_ptr = &inventory[i];
                u32b f[OBJ_FLAG_N];

                object_flags(o_ptr, f);
                if ((f[flagset] & flag) &&
                                !(o_ptr->known_flags[flagset] & flag))
                {
                        char o_name[80];
                        object_desc(o_name, sizeof(o_name), o_ptr, FALSE,
                                        ODESC_BASE);

                        /* Notice flags */
                        o_ptr->known_flags[flagset] |= flag;

                        for (size_t j = 0; j < N_ELEMENTS(msgs); j++)
                        {
                                if (msgs[j].flagset == flagset &&
                                                (msgs[j].flag & flag))
                                        msg_format(msgs[j].msg, o_name);
                        }
                }
        }       

        return;
}
__________________
Currently turning (Angband) Japanese.
PaulBlay is offline   Reply With Quote
Old April 12, 2009, 22:43   #5
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by Pete Mack View Post
Surely, surely, we can move to C99 by now, after a whole decade? The only file that enforces c90 is Makefile.win. Everything else assumes the default. (Which is C99 for most compilers...)
I'm no expert, but there are a lot of commits to trunk which are tidying-up to preserve C89 compatibility, so it looks quite important.
Magnate is offline   Reply With Quote
Old April 12, 2009, 22:57   #6
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,947
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by PaulBlay View Post
I also get the following error when using VC++ Command Prompt with Makefile.nmake.

debug.o : warning LNK4217: locally defined symbol __iob imported in function _to_stderr
z-util.o : warning LNK4049: locally defined symbol __iob imported
cave.o : error LNK2019: unresolved external symbol __alloca referenced in function _display_map
score.o : error LNK2001: unresolved external symbol __alloca
Angband.exe : fatal error LNK1120: 1 unresolved externals
Try doing a clean make and going again? (The C89 things should be fixed now.)
__________________
takkaria whispers something about options. -more-
takkaria is offline   Reply With Quote
Old April 13, 2009, 01:44   #7
PaulBlay
Knight
 
Join Date: Jan 2009
Posts: 657
PaulBlay is on a distinguished road
Quote:
Originally Posted by takkaria View Post
Try doing a clean make and going again? (The C89 things should be fixed now.)
It was OK at r1357 (I cleared out all the old *.o files just in case).

I suppose I should have tried one without doing that to see if it was any different, but too late now.
__________________
Currently turning (Angband) Japanese.
PaulBlay is offline   Reply With Quote
Old April 13, 2009, 02:06   #8
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,736
Donated: $40
Pete Mack is on a distinguished road
alloca is not used in angband--it's highly non-portable. Did you change compile options?
Pete Mack is offline   Reply With Quote
Old April 13, 2009, 06:22   #9
PaulBlay
Knight
 
Join Date: Jan 2009
Posts: 657
PaulBlay is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
alloca is not used in angband--it's highly non-portable. Did you change compile options?
No, I used the same makefile both times.
__________________
Currently turning (Angband) Japanese.
PaulBlay is offline   Reply With Quote
Old April 13, 2009, 06:53   #10
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,736
Donated: $40
Pete Mack is on a distinguished road
Are you absolutely sure all the .o files--including those in subdirectories--are compiled with the same compiler? Those errors look suspiciously like mismatched libraries, aka DLL Hell.

Last edited by Pete Mack; April 13, 2009 at 07:00.
Pete Mack is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wanted: Linux user to compile pre-alpha PaulBlay Development 16 April 10, 2009 19:05
How to compile Angband page PaulBlay Oook! 2 February 20, 2009 12:51
Getting Visual C++ 2008 Express Edition to compile Angband 3.0.9 Orillian Vanilla 5 February 10, 2008 09:23
Compile failure for 3.0.9 on Mac OS X 10.4.10 TreeFrog Vanilla 4 November 8, 2007 14:58


All times are GMT +1. The time now is 11:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.