Error when compiling code on andLinux

Posted by Dbaker84 on Thu 07 Aug 2008 08:19 AM — 10 posts, 32,867 views.

#0
This code previously compiled on Cygwin, any idea why this is bleeding errors now?

make -s smaug
Compiling o/act_comm.o....
In file included from mud.h:389,
from act_comm.c:22:
weather.h:66: error: variably modified 'weatherMap' at file scope
weather.h:66: error: array type has incomplete element type
weather.h:67: error: variably modified 'weatherDelta' at file scope
weather.h:67: error: array type has incomplete element type
In file included from act_comm.c:22:
mud.h:4484: error: conflicting types for 'smash_tilde'
mud.h:4483: error: previous declaration of 'smash_tilde' was here
mud.h:4789: error: conflicting types for 'interpret'
mud.h:4788: error: previous declaration of 'interpret' was here
mud.h:4793: error: conflicting types for 'one_argument'
mud.h:4792: error: previous declaration of 'one_argument' was here
cc1: warnings being treated as errors
act_comm.c: In function 'translate':
act_comm.c:135: warning: passing argument 3 of 'strncpy' as unsigned due to prototype
act_comm.c: In function 'talk_channel':
act_comm.c:412: warning: passing argument 1 of 'set_char_color' with different width due to prototype
act_comm.c:417: warning: passing argument 1 of 'set_char_color' with different width due to prototype
act_comm.c:422: warning: passing argument 1 of 'set_char_color' with different width due to prototype
act_comm.c:427: warning: passing argument 1 of 'set_char_color' with different width due to prototype
act_comm.c:436: warning: passing argument 1 of 'act' with different width due to prototype
act_comm.c:559: warning: passing argument 1 of 'act' with different width due to prototype
act_comm.c:561: warning: passing argument 1 of 'act' with

<repeat about 1000 times>

make[1]: *** [o/act_comm.o] Error 1
make: *** [all] Error 2
USA #1
Are you using gcc or g++; and which version are you using?
#2
I was using gcc, 4.1.3.

<<deleted post about my knuckleheadedness>>

g++ SEEMS to have worked, let me check it out...good call on that.
Amended on Thu 07 Aug 2008 07:06 PM by Dbaker84
#3
Nope, EXACT same problem as before (can't find function in symbol table). At this point, I honestly have NO idea what to do about this. I suppose I can zip up the entire src if anyone wants to take a look.
USA #4
Depending on what mode it's being compiling with, C doesn't support having different prototypes for the same function name. That is why you were getting errors for functions redeclarations one line after the first declaration; that's how I guessed that you were using gcc instead of g++.
USA #5
Normally you just have -ldl as a linker flag; doesn't that make those go away?
USA #6
Looks like this is a crossposted question of:
http://www.smaugmuds.org/index.php?a=topic&t=3772
#7
-ldl makes it go away, but then it can't find the function in the symbol table which I was under the impression was a linking issue.
#8
Correction to my above post.

It compiles fine with the -ldl flag, but the symbol still isn't found.
Amended on Thu 07 Aug 2008 08:55 PM by Dbaker84
#9
Okay, problem solved.

I stripped out the snippet, and reinstalled it clean. When I did the cedit, I did

cedit sayto create
cedit sayto code do_sayto

For some reason, that worked. I'm not sure if I fubar'd something in the naming of the functions or what, but it works.

Thanks again everyone for all your continued help.