Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, DotBot, Yandex, Bing, Google

Members: 0
Guests: 4
Stats
Files
Topics
Posts
Members
Newest Member
481
3,735
19,370
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Smaug Snippets » Weather Snippet
Forum Rules | Mark all | Recent Posts

Weather Snippet
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2, 3 next >>
Post is unread #21 Jan 27, 2008, 8:29 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

I hate to sound stupid or something, but what's wrong with just using g++ if that works?
       
Post is unread #22 Jan 27, 2008, 8:32 pm
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

g++ causes a million errors. I guess eventually I could figure them out. Was just hoping to stay with gcc.
       
Post is unread #23 Jan 27, 2008, 11:40 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

I don't believe that this particular error has anything to do with gcc vs. g++. So that's probably not the right place to be looking for these multiple definition errors.
       
Post is unread #24 Jan 28, 2008, 5:49 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

G++ causes a million errors because it's stricter compiling, it's checking for things GCC doesn't check for, which I guess technically would mean that you're using outdated coding techniques? I don't know if that's the right term or not, it's too early and math class is far too boring for me to even contemplate thinking. It's honestly probably better in the long run to compile in G++ and sort out all those nasty little errors. As for the multiple definitions of mud.h when you use g++ mind posting them so we can see what it's saying?
       
Post is unread #25 Jan 28, 2008, 10:25 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

Actually, it's usually not that g++ is really finding that many more errors (typically warnings) than gcc, but because the C++ language has late type binding, many things which can be assumed under C might not be nailed down until runtime in C++.

THAT, in turn, means you typically get a zillion warnings about all the ways your code *might* be wrong, whereas gcc would have just spat out one line and been done with it.

I look at it the same way I look at so-called grammer checkers that have been included in most word processing packages these days. Because of my style of writing, I usually get quite a few "too many passive verbs" errors if I let the grammer checker chew on things, but that doesn't mean it's wrong -- just that it might be wrong if I hadn't intended it.
       
Post is unread #26 Jan 28, 2008, 9:04 pm   Last edited Jan 28, 2008, 9:04 pm by Llarn
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

I already have 1/2 my code converted to g++ now. It took all night to do half, what is especially annoying is having to change class to Class everywhere.

Hopefully can nail down why it's not working right, once I'm fully converted to g++

       
Post is unread #27 Jan 28, 2008, 9:11 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

It is a bit of a hassle, but it's worth it in the end. :) I went through the same deal not long ago myself.
       
Post is unread #28 Jan 30, 2008, 9:46 pm   Last edited Jan 30, 2008, 9:55 pm by Llarn
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

Is this normal when you convert to g++? Mayhaps I need to change my Makefile slightly besides just changing from gcc to g++ or something else? I completely converted all the files, this long scrolling list of errors comes up at the end of the compilation and I can't even post them all because putty wont scroll back that far.

build.c:(.text+0xd8d5): undefined reference to `quick_link(char*, char*, unsigned long)'
build.c:(.text+0xd98e): undefined reference to `str_alloc(char*, char*, unsigned long)'
build.c:(.text+0xda64): undefined reference to `str_alloc(char*, char*, unsigned long)'
build.c:(.text+0xdaea): undefined reference to `quick_link(char*, char*, unsigned long)'
build.c:(.text+0xdb85): undefined reference to `str_alloc(char*, char*, unsigned long)'
build.c:(.text+0xdc04): undefined reference to `quick_link(char*, char*, unsigned long)'
o/build.o: In function `do_oset(char_data*, char*)':
build.c:(.text+0x10942): undefined reference to `quick_link(char*, char*, unsigned long)'
build.c:(.text+0x10e00): undefined reference to `str_alloc(char*, char*, unsigned long)'
build.c:(.text+0x10ea5): undefined reference to `str_alloc(char*, char*, unsigned long)'
build.c:(.text+0x10f11): undefined reference to `quick_link(char*, char*, unsigned long)'
build.c:(.text+0x11067): undefined reference to `str_alloc(char*, char*, unsigned long)'
build.c:(.text+0x1108b): undefined reference to `quick_link(char*, char*, unsigned long)'
build.c:(.text+0x11127): undefined reference to `str_alloc(char*, char*, unsigned long)'
build.c:(.text+0x11222): undefined reference to `str_alloc(char*, char*, unsigned long)'
build.c:(.text+0x11249): undefined reference to `quick_link(char*, char*, unsigned long)'
build.c:(.text+0x113d1): undefined reference to `str_alloc(char*, char*, unsigned long)'
build.c:(.text+0x12201): undefined reference to `str_alloc(char*, char*, unsigned long)'
build.c:(.text+0x12278): undefined reference to `quick_link(char*, char*, unsigned long)'
o/channels.o: In function `removename(char**, char const*)':
channels.c:(.text+0x3d0): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/channels.o: In function `addname(char**, char const*)':
channels.c:(.text+0x2055): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/channels.o: In function `do_setchannel(char_data*, char*)':
channels.c:(.text+0x261c): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/channels.o: In function `do_makechannel(char_data*, char*)':
channels.c:(.text+0x2972): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/clans.o: In function `do_makecouncil(char_data*, char*)':
clans.c:(.text+0x143c): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/clans.o:clans.c:(.text+0x1454): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/clans.o: In function `do_council_induct(char_data*, char*)':
clans.c:(.text+0x32b9): undefined reference to `quick_link(char*, char*, unsigned long)'
o/clans.o: In function `do_outcast(char_data*, char*)':
clans.c:(.text+0x390c): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/clans.o: In function `do_induct(char_data*, char*)':
clans.c:(.text+0x3c24): undefined reference to `quick_link(char*, char*, unsigned long)'
o/clans.o: In function `do_setcouncil(char_data*, char*)':
clans.c:(.text+0x3ed6): undefined reference to `str_alloc(char*, char*, unsigned long)'
clans.c:(.text+0x4119): undefined reference to `str_alloc(char*, char*, unsigned long)'
clans.c:(.text+0x4286): undefined reference to `str_alloc(char*, char*, unsigned long)'
clans.c:(.text+0x4325): undefined reference to `str_alloc(char*, char*, unsigned long)'
clans.c:(.text+0x4362): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/clans.o:clans.c:(.text+0x45ca): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/comm.o: In function `cleanup_memory()':
comm.c:(.text+0x5f1e): undefined reference to `free_all_bans()'
o/copyover.o: In function `copyover_recover()':
copyover.c:(.text+0x207): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/db.o: In function `make_room(int)':
db.c:(.text+0x8bc): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/db.o: In function `load_area(_IO_FILE*)':
db.c:(.text+0x3f9b): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/db.o: In function `fread_string(_IO_FILE*)':
db.c:(.text+0x4094): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/db.o: In function `make_object(int, int, char*)':
db.c:(.text+0x6aeb): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/db.o:db.c:(.text+0x6b44): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/db.o: In function `make_object(int, int, char*)':
db.c:(.text+0x6be2): undefined reference to `quick_link(char*, char*, unsigned long)'
db.c:(.text+0x6bf9): undefined reference to `quick_link(char*, char*, unsigned long)'
db.c:(.text+0x6c10): undefined reference to `quick_link(char*, char*, unsigned long)'
db.c:(.text+0x6d43): undefined reference to `quick_link(char*, char*, unsigned long)'
db.c:(.text+0x6d5b): undefined reference to `quick_link(char*, char*, unsigned long)'
o/db.o: In function `make_mobile(int, int, char*)':
db.c:(.text+0x6fcc): undefined reference to `str_alloc(char*, char*, unsigned long)'
db.c:(.text+0x7005): undefined reference to `str_alloc(char*, char*, unsigned long)'
db.c:(.text+0x7035): undefined reference to `str_alloc(char*, char*, unsigned long)'
db.c:(.text+0x715d): undefined reference to `quick_link(char*, char*, unsigned long)'
db.c:(.text+0x717e): undefined reference to `quick_link(char*, char*, unsigned long)'
db.c:(.text+0x719f): undefined reference to `quick_link(char*, char*, unsigned long)'
o/db.o: In function `create_object(obj_index_data*, int)':
db.c:(.text+0x811e): undefined reference to `quick_link(char*, char*, unsigned long)'
db.c:(.text+0x8136): undefined reference to `quick_link(char*, char*, unsigned long)'
o/db.o:db.c:(.text+0x814e): more undefined references to `quick_link(char*, char*, unsigned long)' follow
o/db.o: In function `load_buildlist()':
db.c:(.text+0xc479): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/editor.o: In function `editdata_to_str(editor_data*)':
editor.c:(.text+0xd8a): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/editor.o: In function `set_editor_desc(char_data*, char*)':
editor.c:(.text+0x113b): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/editor.o: In function `editor_clear_buf(char_data*, editor_data*, char*)':
editor.c:(.text+0x1f7b): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/editor.o: In function `start_editing_nolimit(char_data*, char*, short)':
editor.c:(.text+0x2082): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/editor.o:editor.c:(.text+0x217b): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/fight.o: In function `start_fearing(char_data*, char_data*)':
fight.c:(.text+0x3992): undefined reference to `quick_link(char*, char*, unsigned long)'
o/fight.o: In function `start_hating(char_data*, char_data*)':
fight.c:(.text+0x3a36): undefined reference to `quick_link(char*, char*, unsigned long)'
o/fight.o: In function `start_hunting(char_data*, char_data*)':
fight.c:(.text+0x3ada): undefined reference to `quick_link(char*, char*, unsigned long)'
o/fight.o: In function `damage(char_data*, char_data*, int, int)':
fight.c:(.text+0x5eac): undefined reference to `quick_link(char*, char*, unsigned long)'
fight.c:(.text+0x5f34): undefined reference to `quick_link(char*, char*, unsigned long)'
o/gboard.o: In function `handle_con_note_to(descriptor_data*, char*)':
gboard.c:(.text+0x15f): undefined reference to `str_alloc(char*, char*, unsigned long)'
gboard.c:(.text+0x1a6): undefined reference to `str_alloc(char*, char*, unsigned long)'
gboard.c:(.text+0x216): undefined reference to `str_alloc(char*, char*, unsigned long)'
gboard.c:(.text+0x270): undefined reference to `str_alloc(char*, char*, unsigned long)'
gboard.c:(.text+0x2e8): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/gboard.o:gboard.c:(.text+0xa1a): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/handler.o: In function `clone_object(obj_data*)':
handler.c:(.text+0x1f58): undefined reference to `quick_link(char*, char*, unsigned long)'
handler.c:(.text+0x1f6f): undefined reference to `quick_link(char*, char*, unsigned long)'
handler.c:(.text+0x1f89): undefined reference to `quick_link(char*, char*, unsigned long)'
handler.c:(.text+0x1fa6): undefined reference to `quick_link(char*, char*, unsigned long)'
o/handler.o: In function `stralloc_printf(char**, char*, ...)':
handler.c:(.text+0x7c0f): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/hint.o: In function `read_hint(char*, _IO_FILE*)':
hint.c:(.text+0xe1): undefined reference to `str_alloc(char*, char*, unsigned long)'
hint.c:(.text+0x204): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/hint.o: In function `do_hintedit(char_data*, char*)':
hint.c:(.text+0x87a): undefined reference to `str_alloc(char*, char*, unsigned long)'
hint.c:(.text+0xa41): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/house.o:house.c:(.text+0x1176): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/hometowns.o: In function `load_htowns()':
hometowns.c:(.text+0x4c9): undefined reference to `load_htown_file(char const*)'
o/hometowns.o: In function `do_sethtown(char_data*, char*)':
hometowns.c:(.text+0xf3b): undefined reference to `str_alloc(char*, char*, unsigned long)'
hometowns.c:(.text+0xfbc): undefined reference to `str_alloc(char*, char*, unsigned long)'
hometowns.c:(.text+0x103d): undefined reference to `str_alloc(char*, char*, unsigned long)'
hometowns.c:(.text+0x1195): undefined reference to `str_alloc(char*, char*, unsigned long)'
hometowns.c:(.text+0x1265): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/hometowns.o:hometowns.c:(.text+0x1303): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/mud_comm.o: In function `do_mpmset(char_data*, char*)':
mud_comm.c:(.text+0x2105): undefined reference to `quick_link(char*, char*, unsigned long)'
mud_comm.c:(.text+0x26bb): undefined reference to `str_alloc(char*, char*, unsigned long)'
mud_comm.c:(.text+0x2738): undefined reference to `str_alloc(char*, char*, unsigned long)'
mud_comm.c:(.text+0x27e3): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/mud_comm.o: In function `do_mpinduct(char_data*, char*)':
mud_comm.c:(.text+0x7208): undefined reference to `quick_link(char*, char*, unsigned long)'
o/mud_comm.o: In function `do_mpoutcast(char_data*, char*)':
mud_comm.c:(.text+0x7448): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/mud_comm.o: In function `do_mppersonalize(char_data*, char*)':
mud_comm.c:(.text+0x777c): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/mud_prog.o: In function `rset_supermob(room_index_data*)':
mud_prog.c:(.text+0x541): undefined reference to `quick_link(char*, char*, unsigned long)'
mud_prog.c:(.text+0x5b4): undefined reference to `quick_link(char*, char*, unsigned long)'
mud_prog.c:(.text+0x655): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/mud_prog.o: In function `set_supermob(obj_data*)':
mud_prog.c:(.text+0x783): undefined reference to `quick_link(char*, char*, unsigned long)'
mud_prog.c:(.text+0x825): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/mud_prog.o: In function `mprog_driver(char*, char_data*, char_data*, obj_data*, void*, bool)':
mud_prog.c:(.text+0x4e1e): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/new_auth.o: In function `do_name(char_data*, char*)':
new_auth.c:(.text+0xb5d): undefined reference to `str_alloc(char*, char*, unsigned long)'
new_auth.c:(.text+0xbc6): undefined reference to `str_alloc(char*, char*, unsigned long)'
new_auth.c:(.text+0xc02): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/new_auth.o: In function `check_auth_state(char_data*)':
new_auth.c:(.text+0x102b): undefined reference to `quick_link(char*, char*, unsigned long)'
new_auth.c:(.text+0x108c): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/new_auth.o: In function `add_to_auth(char_data*)':
new_auth.c:(.text+0x1176): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/new_auth.o: In function `do_authorize(char_data*, char*)':
new_auth.c:(.text+0x15cd): undefined reference to `quick_link(char*, char*, unsigned long)'
new_auth.c:(.text+0x1653): undefined reference to `quick_link(char*, char*, unsigned long)'
new_auth.c:(.text+0x16ff): undefined reference to `quick_link(char*, char*, unsigned long)'
new_auth.c:(.text+0x1844): undefined reference to `quick_link(char*, char*, unsigned long)'
new_auth.c:(.text+0x1a94): undefined reference to `quick_link(char*, char*, unsigned long)'
o/news.o: In function `align_news(char*)':
news.c:(.text+0x628): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/player.o: In function `do_prompt(char_data*, char*)':
player.c:(.text+0x9d5): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/player.o: In function `do_fprompt(char_data*, char*)':
player.c:(.text+0xbd5): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/player.o: In function `set_title(char_data*, char*)':
player.c:(.text+0x18c4): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/polymorph.o: In function `do_morphset(char_data*, char*)':
polymorph.c:(.text+0x4a55): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/polymorph.o:polymorph.c:(.text+0x5aeb): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/races.o: In function `load_races()':
races.c:(.text+0x153c): undefined reference to `load_race_file(char const*)'
o/reset.o: In function `list_resets(char_data*, area_data*, room_index_data*, int, int)':
reset.c:(.text+0x11ef): undefined reference to `wear_locs'
o/reset.o: In function `reset_area(area_data*)':
reset.c:(.text+0x2224): undefined reference to `str_alloc(char*, char*, unsigned long)'
reset.c:(.text+0x2294): undefined reference to `str_alloc(char*, char*, unsigned long)'
reset.c:(.text+0x22b5): undefined reference to `str_alloc(char*, char*, unsigned long)'
reset.c:(.text+0x241c): undefined reference to `str_alloc(char*, char*, unsigned long)'
reset.c:(.text+0x243d): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/reset.o:reset.c:(.text+0x25a4): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/save.o: In function `fread_obj(char_data*, _IO_FILE*, short)':
save.c:(.text+0x6ee): undefined reference to `quick_link(char*, char*, unsigned long)'
save.c:(.text+0x713): undefined reference to `quick_link(char*, char*, unsigned long)'
save.c:(.text+0x738): undefined reference to `quick_link(char*, char*, unsigned long)'
save.c:(.text+0x75d): undefined reference to `quick_link(char*, char*, unsigned long)'
o/save.o: In function `fread_char(char_data*, _IO_FILE*, bool, bool)':
save.c:(.text+0x2e55): undefined reference to `str_alloc(char*, char*, unsigned long)'
save.c:(.text+0x4439): undefined reference to `str_alloc(char*, char*, unsigned long)'
save.c:(.text+0x445b): undefined reference to `str_alloc(char*, char*, unsigned long)'
save.c:(.text+0x4a73): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/save.o: In function `load_char_obj(descriptor_data*, char*, bool, bool)':
save.c:(.text+0x7961): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/save.o:save.c:(.text+0x7f2e): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/symref.o: In function `skill_name(void (*)(char_data*, char*))':
symref.c:(.text+0x2dc6): undefined reference to `do_crouch(char_data*, char*)'
symref.c:(.text+0x2dea): undefined reference to `do_crawl(char_data*, char*)'
o/symref.o: In function `skill_function(char*)':
symref.c:(.text+0x3e20): undefined reference to `do_crawl(char_data*, char*)'
symref.c:(.text+0x3e54): undefined reference to `do_crouch(char_data*, char*)'
o/tables.o: In function `load_tongues()':
tables.c:(.text+0x5b0): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/trade.o: In function `create_wood(char_data*, short, int, bool, room_index_data*)':
trade.c:(.text+0x81f): undefined reference to `str_alloc(char*, char*, unsigned long)'
trade.c:(.text+0x88d): undefined reference to `str_alloc(char*, char*, unsigned long)'
trade.c:(.text+0x901): undefined reference to `str_alloc(char*, char*, unsigned long)'
trade.c:(.text+0x98c): undefined reference to `str_alloc(char*, char*, unsigned long)'
o/trade.o:trade.c:(.text+0x9fa): more undefined references to `str_alloc(char*, char*, unsigned long)' follow
o/weather.o: In function `EnforceClimateConditions()':
weather.c:(.text+0x56): undefined reference to `weatherMap'
weather.c:(.text+0x5d): undefined reference to `weatherDelta'
weather.c:(.text+0x63): undefined reference to `weatherMap'
o/weather.o: In function `getWeatherCell(area_data*)':
weather.c:(.text+0xaf1): undefined reference to `weatherMap'
o/weather.o: In function `ApplyDeltaChanges()':
weather.c:(.text+0xf49): undefined reference to `weatherMap'
weather.c:(.text+0xf50): undefined reference to `weatherDelta'
o/weather.o: In function `fread_cell(_IO_FILE*, int, int)':
weather.c:(.text+0x3338): undefined reference to `weatherMap'
o/weather.o: In function `save_weathermap()':
weather.c:(.text+0x3664): undefined reference to `weatherMap'
weather.c:(.text+0x3682): undefined reference to `weatherMap'
o/weather.o: In function `RandomizeCells()':
weather.c:(.text+0x3795): undefined reference to `weatherMap'
weather.c:(.text+0x37b3): undefined reference to `weatherMap'
o/weather.o:weather.c:(.text+0x6ead): more undefined references to `weatherMap' follow
o/weather.o: In function `CalculateCellToCellChanges()':
weather.c:(.text+0x7087): undefined reference to `weatherDelta'
weather.c:(.text+0x728b): undefined reference to `weatherMap'
weather.c:(.text+0x7319): undefined reference to `weatherDelta'
o/weather.o: In function `ClearWeatherDeltas()':
weather.c:(.text+0x7467): undefined reference to `weatherDelta'
o/weather.o: In function `do_setweather(char_data*, char*)':
weather.c:(.text+0x7610): undefined reference to `weatherMap'
o/weather.o: In function `do_showweather(char_data*, char*)':
weather.c:(.text+0x77e4): undefined reference to `weatherMap'
weather.c:(.text+0x781b): undefined reference to `weatherMap'
collect2: ld returned 1 exit status



       
Post is unread #29 Jan 30, 2008, 10:12 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

You might need to delete all .o files and then recompile ('make clean' followed by 'make').
       
Post is unread #30 Jan 30, 2008, 10:30 pm
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

I still got the errors :(

What I did was originally just change gcc to g++ in my makefile. Then I make clean, and fixed each file one at a time using smaugfuss as a reference if I was confused on what to do with the errors. When I finally got to the last file, and corrected it, it spit out those piles of undefined reference errors.

       
Post is unread #31 Jan 30, 2008, 10:43 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Well alot of those appear to be related to str_alloc and quick_link from the hashstr.c file. It looks like for some reason you have code somewhere where str_alloc is prototyped as str_alloc(char*, char*, unsigned long), when the actual function is: char *str_alloc( char *str )

This could be due to how your macros are setup to call the function. Same with quick_link. You'll want to make sure the prototypes match the actual functions.
       
Post is unread #32 Jan 30, 2008, 11:11 pm
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

This is what I have for my memory allocation in mud.h

[code]
/* Memory allocation macros. */
#define CREATE(result, type, number) \
do \
{ \
if(!((result) = (type *) calloc ((number), sizeof(type)))) \
{ \
perror("malloc failure";); \
fprintf(stderr, "Malloc failure @ %s:%d\n", __FILE__, __LINE__); \
abort(); \
} \
} while(0)

#define RECREATE(result,type,number) \
do \
{ \
if(!((result) = (type *) realloc ((result), sizeof(type) * (number)))) \
{ \
perror("realloc failure";); \
fprintf(stderr, "Realloc failure @ %s:%d\n", __FILE__, __LINE__); \
abort(); \
} \
} while(0)

#define DISPOSE(point) \
do \
{ \
if(!(point)) \
{ \
bug("Freeing null pointer %s:%d", __FILE__, __LINE__); \
fprintf(stderr, "DISPOSEing NULL in %s, line %d\n", __FILE__, __LINE__); \
} \
else \
{ \
free((point)); \
(point) = NULL; \
} \
} while(0)

#ifdef HASHSTR
#define STRALLOC(point) str_alloc((point), __FILE__, __LINE__)
#define QUICKLINK(point) quick_link((point), __FILE__, __LINE__)
#define STRFREE(point) \
do \
{ \
if(point != NULL) \
{ \
if(!(point)) \
{ \
bug("Freeing null pointer %s:%d", __FILE__, __LINE__); \
fprintf(stderr, "STRFREEing NULL in %s, line %d\n", __FILE__, __LINE__); \
} \
else \
{ \
if(str_free((point)) == -1) \
fprintf(stderr, "STRFREEing bad pointer in %s, line %d\n", __FILE__, __LINE__); \
(point) = NULL; \
} \
} \
} while(0)
#else
#define STRALLOC(point) str_dup((point))
#define QUICKLINK(point) str_dup((point))
#define STRFREE(point) \
do \
{ \
if(!(point)) \
{ \
bug("Freeing null pointer %s:%d", __FILE__, __LINE__); \
fprintf(stderr, "STRFREEing NULL in %s, line %d\n", __FILE__, __LINE__); \
} \
else \
{ \
free((point)); \
(point) = NULL; \
} \
} while(0)
#endif

void stralloc_printf(char **pointer, char *fmt, ...);
void strdup_printf(char **pointer, char *fmt, ...);
#define VLD_STR(data) ((data) != NULL && (data)[0] != '\0')

/* double-linked list handling macros -Thoric */
/* Updated by Scion 8/6/1999 */
#define LINK(link, first, last, next, prev) \
do \
{ \
if(!(first)) \
{ \
(first) = (link); \
(last) = (link); \
} \
else \
(last)->next = (link); \
(link)->next = NULL; \
if(first == link) \
(link)->prev = NULL; \
else \
(link)->prev = (last); \
(last) = (link); \
} while(0)

#define INSERT(link, insert, first, next, prev) \
do \
{ \
(link)->prev = (insert)->prev; \
if(!(insert)->prev) \
(first) = (link); \
else \
(insert)->prev->next = (link); \
(insert)->prev = (link); \
(link)->next = (insert); \
} while(0)

#define UNLINK(link, first, last, next, prev) \
do \
{ \
if(!(link)->prev) \
{ \
(first) = (link)->next; \
if((first)) \
(first)->prev = NULL; \
} \
else \
{ \
(link)->prev->next = (link)->next; \
} \
if(!(link)->next) \
{ \
(last) = (link)->prev; \
if((last)) \
(last)->next = NULL; \
} \
else \
{ \
(link)->next->prev = (link)->prev; \
} \
} while(0)

#define CHECK_LINKS(first, last, next, prev, type) \
do { \
type *ptr, *pptr = NULL; \
if(!(first) && !(last)) \
break; \
if(!(first)) \
{ \
bug("CHECK_LINKS: last with NULL first! %s.", \
__STRING(first)); \
for(ptr = (last); ptr->prev; ptr = ptr->prev); \
(first) = ptr; \
} \
else if(!(last)) \
{ \
bug("CHECK_LINKS: first with NULL last! %s.", \
__STRING(first)); \
for(ptr = (first); ptr->next; ptr = ptr->next); \
(last) = ptr; \
} \
if((first)) \
{ \
for(ptr = (first); ptr; ptr = ptr->next) \
{ \
if(ptr->prev != pptr) \
{ \
bug("CHECK_LINKS(%s): %p:->prev != %p. Fixing.", \
__STRING(first), ptr, pptr); \
ptr->prev = pptr; \
} \
if(ptr->prev && ptr->prev->next != ptr) \
{ \
bug("CHECK_LINKS(%s): %p:->prev->next != %p. Fixing.",\
__STRING(first), ptr, ptr); \
ptr->prev->next = ptr; \
} \
pptr = ptr; \
} \
pptr = NULL; \
} \
if((last)) \
{ \
for(ptr = (last); ptr; ptr = ptr->prev) \
{ \
if(ptr->next != pptr) \
{ \
bug("CHECK_LINKS (%s): %p:->next != %p. Fixing.", \
__STRING(first), ptr, pptr); \
ptr->next = pptr; \
} \
if(ptr->next && ptr->next->prev != ptr) \
{ \
bug("CHECK_LINKS(%s): %p:->next->prev != %p. Fixing.",\
__STRING(first), ptr, ptr); \
ptr->next->prev = ptr; \
} \
pptr = ptr; \
} \
} \
} while(0)
       
Post is unread #33 Jan 31, 2008, 12:12 am
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

It looks like I misunderstood what you were saying at first. I found the 2 culprit lines you were referring too. Gotta clean it up a bit then will see how it all looks.

       
Post is unread #34 Jan 31, 2008, 12:29 am   Last edited Jan 31, 2008, 12:32 am by Llarn
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

Wow now I'm getting piles of multiple definitions first defined here errors. Is that the g++ compiler taking things from mud.h and using them through your whole code instead instead of having to define some things in every function like gcc requires?

Nope thats not it, it is looking at stuff from mud.h like my housing code and saying I'm defining it other pieces of code like comm.c and I have no housing code or reference to housing code in that file other then mud.h

Vladaar
       
Post is unread #35 Jan 31, 2008, 12:53 am
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

This is crazy, it's like mud.h is being called in the first file, and the compiler is remembering that from the first file and saying I have multiple definitions throughout the entire code. Even with things that are only defined the one time in mud.h

       
Post is unread #36 Jan 31, 2008, 1:06 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Multiple includes of mud.h are not a problem, as I said several posts ago, unless the .h file is doing something it really shouldn't be (which, in the standard distribution, it does not). If you have multiple definitions of functions, you are either actually defining them multiple times in .c files, or you're including .c files in each other, or you have the object files several times.
       
Post is unread #37 Jan 31, 2008, 1:13 am
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

Example This is an attempt to make clean No I haven't defined alias in imc.c

Compiling o/imc.o....
cc1plus: warnings being treated as errors
h/mud.h:3540: warning: redundant redeclaration of âvoid do_alias(CHAR_DATA*, char*)â in same scope
h/alias.h:30: warning: previous declaration of âvoid do_alias(CHAR_DATA*, char*)â
h/mud.h:3613: warning: redundant redeclaration of âvoid do_color(CHAR_DATA*, char*)â in same scope
h/color.h:22: warning: previous declaration of âvoid do_color(CHAR_DATA*, char*)â
h/mud.h:4489: warning: redundant redeclaration of âvoid set_char_color(short int, CHAR_DATA*)â in same scope
h/color.h:25: warning: previous declaration of âvoid set_char_color(short int, CHAR_DATA*)â
h/mud.h:4490: warning: redundant redeclaration of âvoid set_pager_color(short int, CHAR_DATA*)â in same scope
h/color.h:26: warning: previous declaration of âvoid set_pager_color(short int, CHAR_DATA*)â
h/mud.h:4499: warning: redundant redeclaration of âchar* obj_short(OBJ_DATA*)â in same scope
h/mud.h:4415: warning: previous declaration of âchar* obj_short(OBJ_DATA*)â
h/mud.h:4734: warning: redundant redeclaration of âvoid do_add_imm_host(CHAR_DATA*, char*)â in same scope
h/mud.h:3534: warning: previous declaration of âvoid do_add_imm_host(CHAR_DATA*, char*)â
h/mud.h:4986: warning: redundant redeclaration of âint find_skill_level(CHAR_DATA*, int)â in same scope
h/mud.h:2924: warning: previous declaration of âint find_skill_level(CHAR_DATA*, int)â
h/mud.h:4987: warning: redundant redeclaration of âint hp_max(CHAR_DATA*)â in same scope
h/mud.h:2925: warning: previous declaration of âint hp_max(CHAR_DATA*)â
h/mud.h:4988: warning: redundant redeclaration of âint hp_min(CHAR_DATA*)â in same scope
h/mud.h:2926: warning: previous declaration of âint hp_min(CHAR_DATA*)â
h/mud.h:4989: warning: redundant redeclaration of âbool use_mana(CHAR_DATA*)â in same scope
h/mud.h:2927: warning: previous declaration of âbool use_mana(CHAR_DATA*)â
make[1]: *** [o/imc.o] Error 1
make: *** [all] Error 2
       
Post is unread #38 Jan 31, 2008, 1:19 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Please paste these two lines and surrounding context (like the line and the previous/next 5 lines):
h/mud.h:3540: warning: redundant redeclaration of âvoid do_alias(CHAR_DATA*, char*)â in same scope
h/alias.h:30: warning: previous declaration of âvoid do_alias(CHAR_DATA*, char*)
       
Post is unread #39 Jan 31, 2008, 1:27 am
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

OMG, you mean to tell me gcc let me compile for all these years without complaining about 2 do_alias? Yeesh, thanks David

DECLARE_DO_FUN(do_alias);
DECLARE_DO_FUN(do_allow);
DECLARE_DO_FUN(do_angelfire);
DECLARE_DO_FUN(do_anoint);
DECLARE_DO_FUN(do_ansi);
DECLARE_DO_FUN(do_apply);

DECLARE_DO_FUN(do_alias);

void free_aliases(CHAR_DATA * ch);
bool check_alias(CHAR_DATA * ch, char *command, char *argument);
ALIAS_DATA *find_alias(CHAR_DATA * ch, char *argument);
       
Post is unread #40 Jan 31, 2008, 1:37 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Oh. You said you were getting multiple definition errors, but your warnings were about declarations. I hadn't registered that until just now. The term definition means something different from declaration. A function definition isn't just the prototype, it's the actual function body, too.

Anyhow, yes, the problem is that your version of gcc apparently doesn't care about declaring a function several times but your version of g++ does care. There might be a compiler flag to turn this off (you'd have to see the man page) but this warning is not a problem.

That said, mud.h should not, as a question of style, be declaring the same function several times. So when the previous declaration is in the same file, you should get rid of one or the other.
       
Pages:<< prev 1, 2, 3 next >>