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
➜ Need Help Compiling SWR
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #15 on Sun 22 Jun 2003 10:06 PM (UTC) |
| Message
| I just pasted the add_bad_name code you had above into stock SMAUG's misc.c and it compiled OK, so there is nothing wrong with the code as such.The only things I can suggest are:
1. Some bad characters have snuck into the source file, try copying and pasting yourself and see if the problem goes away (eg. from this web page).
2. There is a "define" that changes the meaning of fpos_t or pos.
3. You are using some really out-of-date compiler - which one are you using and on what operating system?
4. You don't have an include for stdio.h which defines fpos_t.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Raistlen
(10 posts) Bio
|
| Date
| Reply #16 on Sun 22 Jun 2003 10:33 PM (UTC) |
| Message
| First off, thanks for your time and patiance. I honestly don't know the first thing about coding, but I'll try my best to follow along.
Quote: 1. Some bad characters have snuck into the source file, try copying and pasting yourself and see if the problem goes away (eg. from this web page).
The source file I'm using is downloaded right from http://www.geocities.com/gendi_uk/files/swrip.tar.gz and I havent changed a single character except for the advice offered here. I searched for this same code in stock SMAUG and SWR, and coudn't find any to replace it with. I suppose this is SWRip specific?
Quote: 2. There is a "define" that changes the meaning of fpos_t or pos.
I'm afraid thats code work that I'm not too familiar with. What should I look for, and where?
Quote: 3. You are using some really out-of-date compiler - which one are you using and on what operating system?
My operating versions were listed as a P.S on my very first post, but I'll repost it. :-P
make version: GNU Make 3.80
GCC version: (GCC) 3.3 (Debian)
Quote: 4. You don't have an include for stdio.h which defines fpos_t.
Glancing at the top of the misc.c file, looks like I do. Is there someplace else to look at? :-/
I appreciated the patiance. :)
-Raist | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #17 on Sun 22 Jun 2003 11:43 PM (UTC) Amended on Sun 22 Jun 2003 11:44 PM (UTC) by Nick Gammon
|
| Message
| Hmmm - a fascinating problem. :)
I compiled it OK on my Mac OS/X and was about to tell you to try again, but then I tried on RedHat Linux and reproduced the problem. ;)
If you type "man fgetpos" you get a clue, here is the relevant section:
The fgetpos and fsetpos functions are alternate interfaces equivalent
to ftell and fseek (with whence set to SEEK_SET), setting and storing
the current value of the file offset into or from the object referenced
by pos. On some non-UNIX systems an fpos_t object may be a complex
object and these routines may be the only way to portably reposition a
text stream.
Relevant sentence in bold. It is indeed a complex structure, like this:
typedef struct
{
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;
typedef struct
{
__off64_t __pos;
__mbstate_t __state;
} _G_fpos64_t;
#ifndef __USE_FILE_OFFSET64
typedef _G_fpos_t fpos_t;
#else
typedef _G_fpos64_t fpos_t;
#endif
You cannot add or subtract from a structure, that is why you are getting the error.
I suggest changing the line and line after to this:
// pos += -2;
// fsetpos(fp, &pos);
fseek(fp, -2, SEEK_CUR);
That is, comment out the "subtract 2" and the next line which sets the position, and replace with fseek, which moves 2 bytes back from the current position, which should do the same thing, although I haven't tested it, it compiles OK.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Raistlen
(10 posts) Bio
|
| Date
| Reply #18 on Mon 23 Jun 2003 12:01 AM (UTC) |
| Message
| That fixed it.
Thank you. =) | | Top |
|
| Posted by
| Darrik Vequir
(24 posts) Bio
|
| Date
| Reply #19 on Mon 01 Dec 2003 04:36 PM (UTC) |
| Message
|
Should anyone else have this problem, please contact me via email ( Darrik~swrip.net ). This is one of three bugs and a backdoor which I inform anyone who sends me an email ( as the license requests ).
Thank you,
Darrik Vequir | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #20 on Mon 01 Dec 2003 05:44 PM (UTC) |
| Message
| | Why not just post it here, if it's of general public interest? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | 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.
67,997 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top