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 ➜ MUDs ➜ MUD Design Concepts ➜ Merc - Compiling with Cygwin and Linking for MCCP?

Merc - Compiling with Cygwin and Linking for MCCP?

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


Posted by Altered   USA  (7 posts)  Bio
Date Fri 30 Jan 2009 06:48 AM (UTC)
Message
Hello,

Since I know there are some sections regarding cygwin, I'm just curious if any coders who use cygwin ever added the mccp patch? I get a clean compile until link time, then I get 5 errors about deflateEnd, deflate_init ect. I made sure that I have -lz added to the link flags but for some reason, zlib doesn't seem to be linking. I've download and installed zlib fresh. Compiled it from scratch but nothing works.

Has anyone had this problem before? Any ideas to fix it?

Thanks,
Chris
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 30 Jan 2009 07:46 AM (UTC)
Message
I have compiled SmaugFuss 1.7 with MCCP and it compiled and linked OK. When testing, it showed it was using compression.

However there was a recent report of a similar thing:

http://www.gammon.com.au/forum/bbshowpost.php?id=9118

I don't know what Cygwin have done, maybe look for a zlib development version or something. Or, try the zlib site itself, and simply download and compile:

http://www.zlib.net/

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Altered   USA  (7 posts)  Bio
Date Reply #2 on Fri 30 Jan 2009 08:45 AM (UTC)
Message
Hello Nick,

Thanks for the reply. I figure out the linking issue. Aparently Cygwin ain't to brite.. If you add -lz at the top of a normal merc/rom make file, -lz doesn't work. But if -lz is called after everthing, it works and links fine.. Don't know why.

EG:
L_FLAGS = -lz

$(CC) $(L_FLAGS) -o merc.exe $(O_FILES)

The above won't link. But if you remove the -lz from lflags and link from here,

$(CC) $(L_FLAGS) -o merc.exe $(O_FILES) -lz <- At the end!

It links fine.

Never had that happen before but that worked. Again, thanks for the reply.

Chris
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Fri 30 Jan 2009 09:15 AM (UTC)

Amended on Fri 30 Jan 2009 09:16 AM (UTC) by Nick Gammon

Message
You know, that sounds vaguely familiar. :)

I think I spent a while, ago, finding the same thing.

My guess is that the linker looks at libraries, in sequence, to see if anything mentioned previously needs that library.

So, for example:


gcc -o test.exe a.o -lmath b.o


Works if a.c needs the math library. However, not if b.c needs it, because the math references in b.c were not noticed at the time it processed -lmath.

Just a guess, but it seems to be supported by the evidence.

Actually, this is supported by the manual entry for gcc, as follows:

Quote:

It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus, foo.o -lz bar.o searches library z after file foo.o but before bar.o. If bar.o refers to functions in z, those functions may not be loaded.



As for what you said:

Quote:

Aparently Cygwin ain't to brite..


Working as documented. ;)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Altered   USA  (7 posts)  Bio
Date Reply #4 on Fri 30 Jan 2009 10:08 AM (UTC)
Message
Hello Nick,

Thanks for the reply again. After the first compile with mccp, I thought all was well. MCCP showed as active in Roaclient. But then I checked out your MushClient and as soon as I turned on compression, it failed and a nice little error message showed up telling me that decompression failed. Anyway, I fixed the issue and then realized that the World Properties in MushClient show whether MCCP is active and also gives some nice details.

Your mud client has some excellent features for both players and mud coders. Very helpful in my case to see if mcp was working correctly.

Thanks a bunch,
Chris
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.


19,847 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.