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
➜ Compile Dystopia, comm.o...errr....strcmp?
|
Compile Dystopia, comm.o...errr....strcmp?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Justin Hayes
(6 posts) Bio
|
| Date
| Wed 20 Aug 2003 06:30 PM (UTC) Amended on Wed 20 Aug 2003 06:34 PM (UTC) by Justin Hayes
|
| Message
| I've compiled and run quite a few different codebases and by far the one with the most problems is probobly Dystopia. I even got CthulhuMud codebase running, which is quite a feat in my eyes. But anyhow, I'm using cygwin...maybe one day I'll switch over to true Unix instead of this cheap Diet Unix....but for now this is what I use. And I'm having a problem compiling dystopia. One of my problems was described in the thread
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=2974
I got all that worked bout past the whole execinfo.h thing, then I got some different errors than him. Here are the errors I get.
$ make
gcc -c -Wall -g comm.c
comm.c:1581: parse error before numeric constant
comm.c:1581: warning: type defaults to `int' in declaration of `exit'
comm.c:1581: conflicting types for `exit'
/usr/include/stdlib.h:65: previous declaration of `exit'
comm.c:1581: warning: data definition has no type or storage class
comm.c: In function `nanny':
comm.c:2355: warning: implicit declaration of function `crypt'
comm.c:2355: warning: passing arg 1 of `strcmp' makes pointer from integer without a cast
comm.c:2363: warning: passing arg 1 of `strcmp' makes pointer from integer without a cast
comm.c:2565: warning: assignment makes pointer from integer without a cast
comm.c:2590: warning: passing arg 1 of `strcmp' makes pointer from integer without a cast
make: *** [comm.o] Error 1
I'm sure they would make perfect sense if I knew what it meant...and I'm sure it's an easy fix. But I just don't know HOW to fix it. If i could get some help with this, it would be GREAT. Thanks for anyone who may be able to help me. | | Top |
|
| Posted by
| Justin Hayes
(6 posts) Bio
|
| Date
| Reply #1 on Wed 20 Aug 2003 08:07 PM (UTC) Amended on Wed 20 Aug 2003 08:42 PM (UTC) by Justin Hayes
|
| Message
|
#if 0
/*
* To do internal backtracs at crashes
*/
void iBacktrace(int iSignal)
{
void *aTrace[10];
char **tString;
char buf[400]; //plenty
int size, i, j, k;
size = backtrace(aTrace, 10);
printf("%s\n", (char *) aTrace[1]);
tString = backtrace_symbols(aTrace, size);
for (i = 0; i < size; i++)
{
bool found = FALSE;
printf("%s\n", tString[i]);
for (j = 0; tString[i][j] != '\0' && !found; j++)
{
if (tString[i][j] == '[')
{
j++;
found = TRUE;
for (k = j ; tString[i][j] != '\0' && tString[i][j] != ']'; j++)
{
buf[j-k] = tString[i][j];
}
buf[j-k] = '\0';
}
}
printf("%s translates to : %s\n", buf, (char *) strtol(buf, NULL, 16));
}
#endif
exit(1);
}
that's the section that i'm getting the error on...about the parsing and the exit thing.
Could someone explain to me what a parsing error is and the usual way to fix it? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #2 on Wed 20 Aug 2003 10:55 PM (UTC) |
| Message
| Ah yes, a parsing error. Well, if you read the whole book on C, and don't do everything in it, that is a parsing error. :)
In your case the endif looks a bit early. You know that "#if 0" means that everything from then on is ignored? Thus you can disregard whatever it is in that block. However the "#endif" turns the compiling back on.
It seems to me that the #endif should be a couple of lines further on, after the closing brace.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Justin Hayes
(6 posts) Bio
|
| Date
| Reply #3 on Wed 20 Aug 2003 11:31 PM (UTC) |
| Message
| *slaps himself in the forehead*
Now why didn't I catch that? Thanks so much. Wow....you dont know how long I've been looking at that code and how many different things I've tried. | | Top |
|
| Posted by
| Justin Hayes
(6 posts) Bio
|
| Date
| Reply #4 on Thu 21 Aug 2003 (UTC) Amended on Thu 21 Aug 2003 12:31 AM (UTC) by Justin Hayes
|
| Message
| Okay, it compiled, got that same error as in the other thread and I ignored it and tried to boot up and I got a Segmentation Fault (core dumped), so I tried to change makefile to read dystopia.exe, tried to boot up again. Still same error. I entered gdb and ran the file, and backtraced and here's what I got.
$ gdb dystopia.exe
GNU gdb 2003-03-03-cvs (cygwin-special)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License,
welcome to change it and/or distribute copies of it under certai
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" f
This GDB was configured as "i686-pc-cygwin"...
(gdb) run
Starting program: /cygdrive/c/justin/random/mud/dystopia/area/dy
Program received signal SIGSEGV, Segmentation fault.
0x004d8537 in main (argc=1, argv=0x10030ec0) at comm.c:443
443 if (argv[2] && argv[2][0])
(gdb) bt
#0 0x004d8537 in main (argc=1, argv=0x10030ec0) at comm.c:443
Any idea's what's going on? the comm.c:443 is that referring to line 443? if so the only thing on that line is
if (argv[2] && argv[2][0])
Any ideas?
FOLLOWUP:
Commenting it out seemed to work fine, I'm not gonna open this up to the public, more like something for me to screw around with so i dont think it's gonna be an issue. Thanks again for your help Nick. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #5 on Thu 21 Aug 2003 08:16 AM (UTC) |
| Message
| | argc is 1 which means you have one argument, and you are testing argument 2. That sounds a bit dodgy. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | 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.
20,809 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top