MinGW / Windows distribute-cache.c build err

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
NikN
Posts: 3
Joined: 2013-03-28T19:24:01-07:00
Authentication code: 6789

MinGW / Windows distribute-cache.c build err

Post by NikN » 2013-03-28T19:43:05-07:00

Apologies if this is a dupe post, but i searched google and these forums for a better / proper solution and could find none...

I'm trying to build ImageMagick 6.8.4 on my Win7 machine using MinGW / MSYS (latest version, gcc 4.7.2) and ran into errors at the linking stage in the make procedure. Specifically, socket send/recv were "undefined" in distribute-cache.c

I googled a general "send/recv" build issue with windows and MinGW, and found that -lws2_32 needed to be added as a library. I attempted to hand-hack the Makefile to add -lws2_32 at the end of the library list, and at least at the end of the configure step it was showing.
However, during build it still threw undefined errors.

Since I don't need the distributed caching (I will be using ImageMagick primarily to load various file types into OpenGL), here is my workaround:
at the top of distribute-cache.c under "Define declerations" i added the following

Code: Select all

#ifdef __WIN32__
#undef send
#undef recv
int do_nothing() { return 0;}
#define send(x, y, z, w) do_nothing()
#define recv(x, y, z, w) do_nothing()
#endif


this allowed my to successfully build.
I'm still not sure if this is something to do with my particular system or what, but I thought I'd put this up here in case someone else was running into the issue

User avatar
magick
Site Admin
Posts: 11063
Joined: 2003-05-31T11:32:55-07:00

Re: MinGW / Windows distribute-cache.c build err

Post by magick » 2013-03-29T03:58:27-07:00

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.4-4 Beta available by sometime tomorrow. Thanks.

NikN
Posts: 3
Joined: 2013-03-28T19:24:01-07:00
Authentication code: 6789

Re: MinGW / Windows distribute-cache.c build err

Post by NikN » 2013-03-29T16:20:13-07:00

Awesome, thanks!
By the way, can you give the steps you use to build on MinGW + windows?
I was having some issues due to pthread and such (which I ironed out using the pthread for windows port) but I want to check if there is a better / easier way

henrywho
Posts: 188
Joined: 2011-08-17T06:46:40-07:00
Authentication code: 8675308

Re: MinGW / Windows distribute-cache.c build err

Post by henrywho » 2013-03-29T18:27:23-07:00

NikN wrote:Awesome, thanks!
By the way, can you give the steps you use to build on MinGW + windows?
I was having some issues due to pthread and such (which I ironed out using the pthread for windows port) but I want to check if there is a better / easier way
I once worked out a way to compile it under mingw32, but it does not work with 6.8.4-3:
http://www.wizards-toolkit.org/discours ... 55ad555195

NikN
Posts: 3
Joined: 2013-03-28T19:24:01-07:00
Authentication code: 6789

Re: MinGW / Windows distribute-cache.c build err

Post by NikN » 2013-03-31T15:58:53-07:00

interesting....let me see if i can use that as a base and make a new build method

broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: MinGW / Windows distribute-cache.c build err

Post by broucaries » 2013-04-01T03:12:31-07:00

gnulib will help also here...

Post Reply