Having trouble with Makefile on a heavily modified DoT code
Posted by Tempest on Fri 12 Nov 2021 06:18 PM — 13 posts, 38,760 views.
Link to the code and build files.
Description of both your old and new servers including what kind of CPU they have and what operating system name and version they use.
What commands you tried to run, where you tried to run them from, and what output messages they produce.
/dawn/src$ make
g++ -c -Wall -g -O com_time.cpp -o obj/com_time.o
rm -f ../dawn
g++ -g -O -lz -o ../dawn \
(all obj files created here) com_time.o
obj/alias.o: In function `do_nickname(char_data*, char*)':
/dawn/src/alias.cpp:320: multiple definition of `do_nickname(char_data*, char*)'
obj/alias.o:/dawn/src/alias.cpp:320: first defined here
obj/alias.o: In function `do_unalias(char_data*, char*)':
/dawn/src/alias.cpp:264: multiple definition of `do_unalias(char_data*, char*)'
obj/alias.o:/dawn/src/alias.cpp:264: first defined here
obj/alias.o: In function `do_alias(char_data*, char*)':
/dawn/src/alias.cpp:161: multiple definition of `do_alias(char_data*, char*)'
obj/alias.o:/dawn/src/alias.cpp:161: first defined here
obj/alias.o: In function `substitute_alias(connection_data*, char*)':
/dawn/src/alias.cpp:27: multiple definition of `substitute_alias(connection_data*, char*)'
obj/alias.o:/dawn/src/alias.cpp:27: first defined here
obj/com_time.o: In function `get_compile_time(bool)':
/dawn/src/com_time.cpp:15: multiple definition of `get_compile_time(bool)'
obj/com_time.o:/dawn/src/com_time.cpp:15: first defined here
obj/com_time.o: In function `do_compile_time(char_data*, char*)':
/dawn/src/com_time.cpp:58: multiple definition of `do_compile_time(char_data*, char*)'
obj/com_time.o:/dawn/src/com_time.cpp:58: first defined here
obj/act_comm.o: In function `do_report(char_data*, char*)':
/dawn/src/act_comm.cpp:4298: undefined reference to `do_osay(char_data*, char*)'
obj/act_comm.o: In function `do_immerse(char_data*, char*)':
/dawn/src/act_comm.cpp:5997: undefined reference to `do_osay(char_data*, char*)'
/dawn/src/act_comm.cpp:5998: undefined reference to `do_odeaf(char_data*, char*)'
/dawn/src/act_comm.cpp:6004: undefined reference to `do_osay(char_data*, char*)'
/dawn/src/act_comm.cpp:6005: undefined reference to `do_odeaf(char_data*, char*)'
obj/act_comm.o: In function `quit_char(char_data*, char*, bool, bool)':
/dawn/src/act_comm.cpp:3094: undefined reference to `do_disguise(char_data*, char*)'
obj/act_info.o: In function `do_meditate(char_data*, char*)':
/dawn/src/act_info.cpp:13641: undefined reference to `element_table'
/dawn/src/act_info.cpp:13675: undefined reference to `element_table'
/dawn/src/act_info.cpp:13695: undefined reference to `element_table'
obj/ai.o: In function `thief_ai(char_data*, char_data*)':
/dawn/src/ai.cpp:595: undefined reference to `do_lunge(char_data*, char*)'
obj/handler.o: In function `affect_remove_things(char_data*, int)':
(continued in next post)
dawn/src/handler.cpp:2303: undefined reference to `do_fakerace(char_data*, char*)'
obj/interp.o:(.data+0x1508): undefined reference to `do_otell(char_data*, char*)'
obj/interp.o:(.data+0x1588): undefined reference to `do_oreply(char_data*, char*)'
obj/interp.o:(.data+0x1908): undefined reference to `do_osay(char_data*, char*)'
obj/interp.o:(.data+0x1dc8): undefined reference to `do_alia(char_data*, char*)'
obj/interp.o:(.data+0x37c8): undefined reference to `do_camouflage(char_data*, char*)'
obj/interp.o:(.data+0x3808): undefined reference to `do_camouflage(char_data*, char*)'
obj/interp.o:(.data+0x4c48): undefined reference to `do_disguise(char_data*, char*)'
obj/interp.o:(.data+0x4e08): undefined reference to `do_doorway(char_data*, char*)'
obj/interp.o:(.data+0x5088): undefined reference to `do_decipher(char_data*, char*)'
obj/interp.o:(.data+0x5848): undefined reference to `do_familiar(char_data*, char*)'
obj/interp.o:(.data+0x7b88): undefined reference to `do_lunge(char_data*, char*)'
obj/interp.o:(.data+0x8dc8): undefined reference to `do_odeaf(char_data*, char*)'
obj/interp.o:(.data+0x8e88): undefined reference to `do_osay(char_data*, char*)'
obj/interp.o:(.data+0x8ec8): undefined reference to `do_osayto(char_data*, char*)'
obj/interp.o:(.data+0x9588): undefined reference to `do_plant(char_data*, char*)'
obj/interp.o:(.data+0x98c8): undefined reference to `do_powerfocus(char_data*, char*)'
obj/interp.o:(.data+0x9908): undefined reference to `do_powertransfer(char_data*, char*)'
obj/interp.o:(.data+0xb708): undefined reference to `do_shadowfold(char_data*, char*)'
obj/interp.o:(.data+0xb748): undefined reference to `do_shadowveil(char_data*, char*)'
obj/interp.o:(.data+0xb788): undefined reference to `do_shadowwalk(char_data*, char*)'
obj/interp.o:(.data+0xc088): undefined reference to `do_spackle(char_data*, char*)'
obj/interp.o:(.data+0xcc08): undefined reference to `do_oatell(char_data*, char*)'
obj/interp.o:(.data+0xcc48): undefined reference to `do_otell(char_data*, char*)'
obj/magic_tr.o: In function `spell_shapeshift(int, int, char_data*, void*, int)':
/dawn/src/magic_tr.cpp:47: undefined reference to `do_fakerace(char_data*, char*)'
obj/magic.o: In function `check_raise_element(char_data*, int, bool, int)':
/dawn/src/magic.cpp:2561: undefined reference to `element_table'
/dawn/src/magic.cpp:2570: undefined reference to `element_table'
obj/oedit.o: In function `show_obj_values(char_data*, obj_index_data*)':
/dawn/src/oedit.cpp:597: undefined reference to `element_table'
obj/oedit.o: In function `set_obj_values(char_data*, obj_index_data*, int, char*)':
/dawn/src/oedit.cpp:1726: undefined reference to `element_table'
/dawn/src/oedit.cpp:1735: undefined reference to `element_table'
obj/update.o: In function `char_update()':
/dawn/src/update.cpp:3537: undefined reference to `do_shadowveil(char_data*, char*)'
collect2: ld returned 1 exit status
make: *** [dawn] Error 1
I tried to compile DoT recently, to help someone else.
I got so many error messages that, in the end, I just gave up.
It ought to work, after all the server compiled and ran fine in the past.
However when code isn’t maintained for a few years it can suffer from problems because the compiler-writers tighten up the rules, generally being a good idea because that helps catch problems caused by ambiguous code.
I mention on this page that nothing much has happened since 2009 (12 years ago).
In my case, I wasn’t strongly motivated enough to spend days to work out what the issues were. If you are keen to get it working, then you can probably sort things out. :)
You seem to have problems with both multiple definitions of functions, and others not being defined at all. If you can solve one of those you can probably solve all of them.
Try doing a global search (eg. using grep) to find what is causing these.
edited to add: Could this be a link complaint and not a case of multiple or undefined definitions?
/dawn/src/alias.cpp:321: multiple definition of `do_nickname(char_data*, char*)'
obj/alias.o:/home/oblivion/dawn/src/alias.cpp:321: first defined here
/dawn/src$ grep -r "nickname"
act_info.cpp: ch->printlnf("You will see %s along with short descriptions.",HAS_PCONFIG(ch,PCONFIG_NICKNAMES)?"nicknames":"actual names");
act_info.cpp: ch->println(" config nicknames - Toggles seeing nicknames instead of actual names");
act_info.cpp: if (!str_prefix(argument,"nicknames")){
act_info.cpp: ch->printlnf("Config for nicknames toggled %s.",HAS_PCONFIG(ch,PCONFIG_NICKNAMES)?"on":"off");
alias.cpp: void do_nickname(char_data *ch, char *argument)
alias.cpp: ch->println("You have no nicknames defined.");
alias.cpp: ch->println("Your current nicknames are:");
alias.cpp: ch->println("To delete nicknames, type 'nickname delete <character's actual name>'.");
alias.cpp: ch->printlnf("Give `w%s `xwhat nickname?",capitalize(arg1));
alias.cpp: ch->printlnf("The nickname '`w%s`x' cannot be found in your list.",capitalize(arg2));
alias.cpp: //need to add check so two people can't have the same nickname
alias.cpp: ch->println("You already have someone by that nickname");
alias.cpp: ch->println("You can't give someone the nickname of an existing player.");
alias.cpp: ch->println("You cannot give anyone this nickname.");
alias.cpp: ch->printlnf("The nickname for `w%s`x has been changed to '%s'.",
alias.cpp: if (!str_cmp(arg2,ch->pcdata->nick)){ // check if the nickname is already used
alias.cpp: ch->printlnf("You are already using the nickname '`w%s`x' for `w%s`x.",
alias.cpp: ch->println("Sorry, you have reached the limit for nicknames.");
dawn.h #define PCONFIG_NICKNAMES (U)
handler.cpp: bool has_nickname(char_data *ch,char_data *looker,char *nickname);
handler.cpp: /*&& (!IS_NPC(ch) && !has_nickname(rch,ch,arg))*/)
interp.cpp: { "nickname", do_nickname, POS_DEAD, 0, LOG_NORMAL, 1, 0 },
interp.h: DECLARE_DO_FUN( do_nickname )
intro_ex.cpp: bool has_nickname(char_data *ch,char_data *looker,char *nickname)
intro_ex.cpp: char *get_nickname(char_data *looker, char_data *ch)
intro_ex.cpp: sprintf(nick,"%s",get_nickname(looker,ch));
intro_ex.cpp: || has_nickname(ch,looker,ch->current_name(looker))))){
save.cpp: ch->pcdata->nick[nickcount] = fread_string(fp); //the nickname
tables.cpp: { "nicknames", PCONFIG_NICKNAMES, true},
It’s almost like the object is being linked twice. For example:
obj/alias.o: In function `do_nickname(char_data*, char*)':
/dawn/src/alias.cpp:320: multiple definition of `do_nickname(char_data*, char*)'
obj/alias.o:/dawn/src/alias.cpp:320: first defined here
That seems to be saying that it found a problem in alias.cpp line 320, that there was a duplicate, and the duplicate was in exactly the same file at the same place!
So, I would be looking more closely at how it links things.
The code compiled and made the dawn executable file, booted and hotrebooted.
I can not express the extent of my giddyness at the moment.
Thank you so much for your help Nick. Now I just get to figure out how to code classes, skills and spells to make this remake even better. <3 <3 <3
Thanks a lot, and congratulations!
True to form, they made certain to humble-brag about getting the code to compile and run properly before disappearing.
I'm sure that as soon as they hit the next snag and can't figure something else out, they'll be back to ask more questions from the same community that they just gave the finger to.
That would certainly help other people in the future.
Let's see shall we?