Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ Compiling the server ➜ Multiple definitions

Multiple definitions

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


Posted by Greven   Canada  (835 posts)  Bio
Date Sun 28 Nov 2004 08:37 AM (UTC)

Amended on Sun 28 Nov 2004 08:45 AM (UTC) by Greven

Message
I'm a little tired, so this may be a stupid question. I am trying to add some code, and I am getting pages of this during linking:
o/imc.o(.bss+0x0): In function `imcstrlcpy(char*, char const*, unsigned)':
/home/mud/darkwars/dwadmins/src/imc.c:124: multiple definition of `imcwait'
imc.o(.bss+0x0):/home/mud/darkwars/dwadmins/src/imc.c:124: first defined here
o/imc.o(.bss+0x4): In function `imcstrlcpy(char*, char const*, unsigned)':
/home/mud/darkwars/dwadmins/src/imc.c:124: multiple definition of `imcconnect_attempts'
imc.o(.bss+0x4):/home/mud/darkwars/dwadmins/src/imc.c:124: first defined here
o/imc.o(.bss+0x8): In function `imcstrlcpy(char*, char const*, unsigned)':
/home/mud/darkwars/dwadmins/src/imc.c:124: multiple definition of `imc_sequencenumber'
imc.o(.bss+0x8):/home/mud/darkwars/dwadmins/src/imc.c:124: first defined here
o/imc.o(.data+0x0): In function `imcstrlcpy(char*, char const*, unsigned)':
/home/mud/darkwars/dwadmins/src/imc.c:124: multiple definition of `imcpacketdebug'
imc.o(.data+0x0):/home/mud/darkwars/dwadmins/src/imc.c:124: first defined here
I've checked all of the include files, making sure they have all the #ifdef __FILE__ in them, and they do. I'm positive this is something simple, but I'm just not thinking clearly. I'm sure that there are not multiple calls of every single function, as these are all included in the same .c file

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Sun 28 Nov 2004 09:23 AM (UTC)
Message
Given that the source lines of the first and second definitions are the same, I'd make sure you're not including imc.o twice in the linking phase or something like that.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #2 on Sun 28 Nov 2004 09:30 AM (UTC)
Message
Yeah, that was it. Thanks, too out of it to notice something simple like that. I was use
C_FILES = account.c act_comm.c act_html.c act_info.c act_move.c act_obj.c \
	  act_wiz.c alias.c arena.c autobuild.c backup.c ban.c \
	  boards.c bounty.c build.c changes.c channels.c clans.c cleanup.c color.c comm.c \
	  comments.c const.c db.c delivery.c designship.c dns.c editor.c \
	  fight.c finger.c handler.c hashstr.c homes.c hotboot.c immcomm.c \
	  implants.c installations.c interp.c magic.c makeobjs.c mccp.c \
	  medic.c misc.c msp.c mud_comm.c mud_prog.c mxp.c occupations.c \
	  olc-shuttle.c olc.c pfiles.c pilot.c player.c quest.c raceskills.c \
	  renumber.c reset.c restore.c save.c sharpen.c shell.c shops.c \
	  skills.c smuggling.c space.c space2.c special.c swskills.c \
	  tables.c track.c update.c vendor.c webroom.c web-server.c wedding.c

O_FILES = $(patsubst %.c,o/%.o,$(C_FILES))

H_FILES = $(wildcard *.h) 

ifdef IMC
   C_FILES := imc.c md5.c $(C_FILES)
   O_FILES := imc.o md5.o $(O_FILES)
endif


Thanks.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
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.


10,253 views.

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

Go to topic:           Search the forum


[Go to top] top

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