Page 1 of 1

MinGW / Windows distribute-cache.c build err

Posted: 2013-03-28T19:43:05-07:00
by NikN
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

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

Posted: 2013-03-29T03:58:27-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.4-4 Beta available by sometime tomorrow. Thanks.

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

Posted: 2013-03-29T16:20:13-07:00
by NikN
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

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

Posted: 2013-03-29T18:27:23-07:00
by henrywho
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

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

Posted: 2013-03-31T15:58:53-07:00
by NikN
interesting....let me see if i can use that as a base and make a new build method

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

Posted: 2013-04-01T03:12:31-07:00
by broucaries
gnulib will help also here...