Compiling source code in Windows
Posted: 2010-08-21T16:23:41-07:00
I tried to compile the current version 6.6.3-8 on Windows and ran into a few problems.
When building the CORE_magick project, the function InitializeCriticalSectionandSpinCount is undefined. The way to make windows define and link this function is to include this define:
But this must occur before the include of <windows.h>. I got around this by putting the define in magick_config.h but there's probably a better way to do it.
When building CORE_lcms, the function sqrtf is undefined. In lcms2_internal.h I added a define inside an existing #ifdef:
In IM_MOD_wmf vsnprintf is undefined so I added this at the front of wmf/src/stream.h:
Pete
When building the CORE_magick project, the function InitializeCriticalSectionandSpinCount is undefined. The way to make windows define and link this function is to include this define:
Code: Select all
#define _WIN32_WINNT 0x0501
When building CORE_lcms, the function sqrtf is undefined. In lcms2_internal.h I added a define inside an existing #ifdef:
Code: Select all
// Other replacement functions
#ifdef _MSC_VER
# ifndef snprintf
# define snprintf _snprintf
# endif
# ifndef vsnprintf
# define vsnprintf _vsnprintf
# endif
//PAH Added this
#define sqrtf(x) (float)sqrt((float)x)
#endif
Code: Select all
#ifdef _MSC_VER
# ifndef vsnprintf
# define vsnprintf _vsnprintf
# endif
#endif