Help me! Please!

Posted by Syrus on Mon 13 Mar 2006 07:35 AM — 5 posts, 21,917 views.

#0
Here's the deal. Running rom24b6 with olc already implemented. I downloaded the latest version of lope's colour code and patched. Hit make and was presented with this -

**********************************************************

$ make
gcc -c -Wall -O -g -DOLD_RAND -DNO_CRYPT comm.c
comm.c: In function `main':
comm.c:422: warning: implicit declaration of function `close'
comm.c: In function `read_from_descriptor':
comm.c:1104: warning: implicit declaration of function `read'
comm.c: In function `write_to_descriptor':
comm.c:1592: warning: implicit declaration of function `write'
comm.c: In function `nanny':
comm.c:1713: warning: implicit declaration of function `crypt'
comm.c:1713: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
comm.c:1825: warning: assignment makes pointer from integer without a cast
comm.c:1848: warning: passing arg 1 of `strcmp' makes pointer from integer witho
ut a cast
comm.c: At top level:
comm.c:2433: error: redefinition of 'page_to_char'
comm.c:2409: error: previous definition of 'page_to_char' was here
make: *** [comm.o] Error 1

***********************************************************

Any help is greatly appreciated.
USA #1
Looks like you have the function page_to_char defined twice. Is this the case? Have you looked at the lines in question and checked to see if you have the function twice? If so why do you have it twice? Which one is the 'correct' one -- supposedly the one you got with the snippet? Then just remove the old one.
#2
Yessiry :) I got that problem fixed up, thanks. Heres another :P

***********************************************************
$ make
rm -f rom
gcc -O -g -o rom act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz
.o alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o handler.o h
ealer.o interp.o note.o lookup.o magic.o magic2.o music.o recycle.o save.o scan.
o skills.o special.o tables.o update.o string.o mem.o bit.o olc.o olc_act.o olc_
save.o -lcrypt
act_comm.o: In function `do_delet':
/home/Saint/rom24/src/act_comm.c:47: undefined reference to `_send_to_char'
act_comm.o: In function `do_delete':
/home/Saint/rom24/src/act_comm.c:61: undefined reference to `_send_to_char'
/home/Saint/rom24/src/act_comm.c:78: undefined reference to `_send_to_char'
/home/Saint/rom24/src/act_comm.c:82: undefined reference to `_send_to_char'
/home/Saint/rom24/src/act_comm.c:83: undefined reference to `_send_to_char'
act_comm.o:/home/Saint/rom24/src/act_comm.c:84: more undefined references to `_s
end_to_char' follow
collect2: ld returned 1 exit status
make: *** [rom] Error 1
***********************************************************
Australia #3

/home/Saint/rom24/src/act_comm.c:47: undefined reference to `_send_to_char'


An undefined reference is where the compiler cannot find the function that is being called from that line of code, in this case its _send_to_char.

Now, this can be caused by a number of things, TYPO, missing library, missing header include are prolly the most common.

send_to_char is a function in rom, so my question is, does the code you have added require you to add in a new function _send_to_char, if it dosnt then i think you could safly remove the preceading underscore and it will compile fine.
USA #4
Sometimes the compilers add in that underscore, so the missing function might actually be send_to_char. Did you rename that page_to_char or something?

Just what did you do when applying this patch? Could you show us the patch? It looks like you did something fairly strange... :)