[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUDs
. -> [Folder]  MUD Design Concepts
. . -> [Subject]  Merc - Compiling with Cygwin and Linking for MCCP?

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Merc - Compiling with Cygwin and Linking for MCCP?

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Altered   USA  (7 posts)  [Biography] bio
Date Fri 30 Jan 2009 06:48 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 30 Jan 2009 07:46 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Altered   USA  (7 posts)  [Biography] bio
Date Reply #2 on Fri 30 Jan 2009 08:45 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Fri 30 Jan 2009 09:15 AM (UTC)  quote  ]

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
[Go to top] top

Posted by Altered   USA  (7 posts)  [Biography] bio
Date Reply #4 on Fri 30 Jan 2009 10:08 AM (UTC)  quote  ]
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
[Go to top] 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.


2,019 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]