[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Compiling the server
. . -> [Subject]  SMAUG Undefined Reference
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

SMAUG Undefined Reference

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Wed 11 Jun 2014 06:44 AM (UTC)
Message
In Mud.H


extern QUEST_DATA * questmaster;

typedef struct quest_data QUEST_DATA;

struct quest_data
{
int     level_range;
int	practice_amt;
int	practice_cost;
int	award_vnum[MAX_QDATA+1];
int	award_value[MAX_QDATA+1];
int	gold_amt;
int	gold_cost;
};


In Quest.c


void quest_list ( CHAR_DATA * ch )
{
    set_char_color ( AT_WHITE, ch );
    short i, count = 0;
    send_to_char ( "&D--------------------------------------------------------------------------------\r\n", ch );
    send_to_char ( "&cItem # Item Price \r\n", ch );
    send_to_char ( "&D--------------------------------------------------------------------------------\r\n", ch );
    for ( i = 0; i <= MAX_QDATA; i++ )
    {
        if ( questmaster->award_vnum && questmaster->award_value )
        {
            ++count;
            ch_printf ( ch, "&c[%2d] &w %-35s &c %-6s \r\n",
                        count, get_obj_index ( questmaster->award_vnum )->short_descr, num_punct ( questmaster->award_value ) );
        }
    }
    ch_printf ( ch, "&c[%2d] &w %s Gold &c 120\r\n", count + 1, num_punct ( questmaster->gold_amt ) );
    ch_printf ( ch, "&c[%2d] &w %d Practices &c %-6s\r\n", count + 2, questmaster->practice_amt, num_punct ( questmaster->practice_cost ) );
    send_to_char ( "&D--------------------------------------------------------------------------------\r\n", ch );
    send_to_char ( "&D Quest Buy # \r\n", ch );
    return;
}


Everything compiles ok, but when it links, it bugs out with the following:

/home/BLAA_BLAA/src/quest.c:1033: undefined reference to `questmaster'
/home/BLAA_BLAA/src/quest.c:1033: undefined reference to `questmaster'
/home/BLAA_BLAA/quest.c:1037: undefined reference to `questmaster'

So what did i miss, and how do i fix it. Porting old code over to run with modern compilers is a nightmare :)

Rob.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #1 on Wed 11 Jun 2014 07:17 AM (UTC)
Message
Dont worry, i found what I missed, left out a chunk of code from db.c that created the questmaster.

I think it is working now, I hope :)

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,308 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]