Please check out Corporate Expanse: From the Cradle !

Member Discussions

terms



[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]


1. moving windows mud to linux server...makefile? Wed Apr 2, 2003 [8:56 PM]
faeson
Email not supplied
member since: Jul 1, 2000
Reply
hey all, what im doing is moving my windows RoT 1.4 over to linux. it wont compile though, i've cd'ed to the src directory and typed 'make' and it doesnt work, i'm thinking its an error with the makefile, anyway, my question is how can i write a makefile so that it will compile under linux? i know it can be done, a year or so ago my coder did it for me with almost the exact same code


2. RE: moving windows mud to linux server...makefile? Wed Apr 2, 2003 [11:46 PM]
DaShiVa
DaShiVa.LunATiC@verizon.net
member since: Aug 10, 2001
In Reply To
Reply
I suggest you dl a few similar codebases, and look at their makefiles, so you can learn how they work in a way relevant to you, and if it's too hard, then you cn just cut'n'paste to make one for your mud... they're fairly basic.


3. RE: moving windows mud to linux server...makefile? Thu Apr 3, 2003 [7:48 AM]
Kastagaar
Email not supplied
member since: Jul 29, 1999
In Reply To
Reply
How does the makefile read? What errors is it generating?

Kas.
There are two ways of constructing software: to make it so simple that there are obviously no errors, and to make it so complex that there are no obvious errors.


4. RE: moving windows mud to linux server...makefile? Thu Apr 3, 2003 [3:48 PM]
faeson
Email not supplied
member since: Jul 1, 2000
In Reply To
Reply
gcc -c -Wall -O -g -DNOCRYPT act_comm.c
In file included from act_comm.c:49:
merc.h:77: warning: redefinition of `u_int'
/usr/include/sys/types.h:36: warning: `u_int' previously declared here
gcc -c -Wall -O -g -DNOCRYPT act_enter.c
In file included from act_enter.c:49:
merc.h:77: warning: redefinition of `u_int'
/usr/include/sys/types.h:36: warning: `u_int' previously declared here
gcc -c -Wall -O -g -DNOCRYPT act_info.c
In file included from act_info.c:50:
merc.h:77: warning: redefinition of `u_int'
/usr/include/sys/types.h:36: warning: `u_int' previously declared here
gcc -c -Wall -O -g -DNOCRYPT act_move.c
In file included from act_move.c:48:
merc.h:77: warning: redefinition of `u_int'
/usr/include/sys/types.h:36: warning: `u_int' previously declared here
gcc -c -Wall -O -g -DNOCRYPT act_obj.c
In file included from act_obj.c:49:
merc.h:77: warning: redefinition of `u_int'
/usr/include/sys/types.h:36: warning: `u_int' previously declared here
gcc -c -Wall -O -g -DNOCRYPT act_wiz.c
In file included from act_wiz.c:49:
merc.h:77: warning: redefinition of `u_int'
/usr/include/sys/types.h:36: warning: `u_int' previously declared here
act_wiz.c: In function `do_check':
act_wiz.c:251: warning: int format, long int arg (arg 11)
act_wiz.c:251: warning: too few arguments for format
act_wiz.c:192: warning: unused variable `last_room'
act_wiz.c: In function `do_mstat':
act_wiz.c:2582: warning: format argument is not a pointer (arg 3)
act_wiz.c:2582: warning: too many arguments for format
act_wiz.c: In function `do_arealinks':
act_wiz.c:7064: warning: `buffer' might be used uninitialized in this function
gcc -c -Wall -O -g -DNOCRYPT alias.c
In file included from alias.c:42:
merc.h:77: warning: redefinition of `u_int'
/usr/include/sys/types.h:36: warning: `u_int' previously declared here
gcc -c -Wall -O -g -DNOCRYPT ban.c
In file included from ban.c:49:
merc.h:77: warning: redefinition of `u_int'
/usr/include/sys/types.h:36: warning: `u_int' previously declared here
gcc -c -Wall -O -g -DNOCRYPT clans.c
In file included from clans.c:49:
merc.h:77: warning: redefinition of `u_int'
/usr/include/sys/types.h:36: warning: `u_int' previously declared here
gcc -c -Wall -O -g -DNOCRYPT comm.c
In file included from comm.c:63:
merc.h:77: warning: redefinition of `u_int'
/usr/include/sys/types.h:36: warning: `u_int' previously declared here
comm.c:176: conflicting types for `getpeername'
/usr/include/sys/socket.h:127: previous declaration of `getpeername'
comm.c:177: conflicting types for `getsockname'
/usr/include/sys/socket.h:115: previous declaration of `getsockname'
comm.c:180: conflicting types for `read'
/usr/include/unistd.h:310: previous declaration of `read'
comm.c:184: conflicting types for `write'
/usr/include/unistd.h:313: previous declaration of `write'
comm.c: In function `nanny':
comm.c:2768: warning: suggest parentheses around assignment used as truth value
comm.c:2773: warning: suggest parentheses around assignment used as truth value
comm.c:2778: warning: suggest parentheses around assignment used as truth value
comm.c:2783: warning: suggest parentheses around assignment used as truth value
comm.c:2788: warning: suggest parentheses around assignment used as truth value
comm.c:2793: warning: suggest parentheses around assignment used as truth value
comm.c:2798: warning: suggest parentheses around assignment used as truth value
comm.c:2803: warning: suggest parentheses around assignment used as truth value
comm.c:4140:9: warning: '/*' within comment
comm.c:4146:9: warning: '/*' within comment
comm.c:4149:17: warning: '/*' within comment
comm.c:4167:17: warning: '/*' within comment
comm.c:4173:17: warning: '/*' within comment
comm.c:4176:25: warning: '/*' within comment
comm.c:4181:25: warning: '/*' within comment
comm.c:4189:33: warning: '/*' within comment
comm.c:4197:41: warning: '/*' within comment
comm.c:4200:49: warning: '/*' within comment
comm.c:4205:57: warning: '/*' within comment
comm.c:4218:65: warning: '/*' within comment
comm.c:4230:25: warning: '/*' within comment
comm.c:4239:17: warning: '/*' within comment
comm.c:4245:17: warning: '/*' within comment
comm.c:4255:9: warning: '/*' within comment
comm.c:4260:17: warning: '/*' within comment
comm.c:4267:9: warning: '/*' within comment
comm.c:4272:17: warning: '/*' within comment
comm.c:4279:17: warning: '/*' within comment
comm.c:4286:17: warning: '/*' within comment
comm.c:4293:9: warning: '/*' within comment
comm.c:4296:17: warning: '/*' within comment
comm.c:4303:17: warning: '/*' within comment
comm.c:4312:9: warning: '/*' within comment
comm.c:4329:9: warning: '/*' within comment
comm.c:4336:25: warning: '/*' within comment
comm.c:4341:25: warning: '/*' within comment
comm.c:4348:41: warning: '/*' within comment
comm.c:4358:49: warning: '/*' within comment
comm.c:4369:9: warning: '/*' within comment
comm.c:4373:17: warning: '/*' within comment
comm.c:4379:9: warning: '/*' within comment
comm.c: In function `printf_to_char':
comm.c:4391: `va_list' undeclared (first use in this function)
comm.c:4391: (Each undeclared identifier is reported only once
comm.c:4391: for each function it appears in.)
comm.c:4391: parse error before 'args'
comm.c:4392: warning: implicit declaration of function `va_start'
comm.c:4392: `args' undeclared (first use in this function)
comm.c:4394: warning: implicit declaration of function `va_end'
make: *** [comm.o] Error 1


5. RE: moving windows mud to linux server...makefile? Thu Apr 3, 2003 [6:06 PM]
Ralgha
Email not supplied
member since: Aug 16, 1999
In Reply To
Reply
Those are not makefile errors.


6. RE: moving windows mud to linux server...makefile? Thu Apr 3, 2003 [7:26 PM]
faeson
Email not supplied
member since: Jul 1, 2000
In Reply To
Reply
it compiles flawlessly on my computer and thats what it shows when i compile in shell...if not errors from the makefile, i dont know what the problem is...


7. RE: moving windows mud to linux server...makefile? Thu Apr 3, 2003 [8:15 PM]
DaShiVa
DaShiVa.LunATiC@verizon.net
member since: Aug 10, 2001
In Reply To
Reply
Yeah, this isn't a makefile problem, it's because you're using a different compiler and different headers.
your linux types.h defines u_int itself, and I guess your windows version doesn't, You'll need to find where it's defined in your code, and add an:

#if defined(u_int)
#undefine(u_int)
#endif


or something along those lines (though this is only for the first error)
your comment and parse warnings will be due to different parsing of files by gdb from whatever you used in windows, you'll need to look at the specified files and lines to check them, unless some are caused by macroes.
I don't code crossplayform at present, so I don't know the exact details, but if you look at a stock merc codebase of some sort (along with mose all codebases) you'll find defines such as:
#if defined(TRADITIONAL)
#define const
#define args( list )            ( )
#define DECLARE_DO_FUN( fun )       void fun( )
#define DECLARE_SPEC_FUN( fun )     bool fun( )
#define DECLARE_SPELL_FUN( fun )    void fun( )
#else
#define args( list )            list
#define DECLARE_DO_FUN( fun )       DO_FUN    fun
#define DECLARE_SPEC_FUN( fun )     SPEC_FUN  fun
#define DECLARE_SPELL_FUN( fun )    SPELL_FUN fun
#endif

or
#if defined(macintosh)
#include 
#else
#include 
#endif

and similar...


8. RE: moving windows mud to linux server...makefile? Thu Apr 3, 2003 [9:30 PM]
Tyche
Email not supplied
member since: Apr 4, 2000
In Reply To
Reply
Those are C compiler errors. The first one to fix is the line 77 of merc.h. You should comment out the definition of u_int. That will probably fix most of your errors. Secondly you've also got some re-declarations of common C runtime system prototypes, or some undeclared C runtime functions. Those can be fixed by removing the declarations and including the proper header files. See man page entries on the C runtime functions in question for which headers to include.


(Comment added by Tyche on Thu Apr 3 23:34:45 2003)

Also those declarations read, write, getpeername are probably OS dependent code demarcated #ifdef's depending on the parameters you pass the compiler (e.g. gcc -DWIN32 or gcc -DLinux)

The Sourcery - http://sourcery.dyndns.org
TeensyMud - http://teensymud.kicks-ass.org
"A man can receive nothing, except it be given him from heaven."




[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]