When compiling libiptcdata on Windows, using MSYS+MinGW, I get 2 undefined references because of link() and chown() in main.c (respectively lines 835 and 850)
Instead of link(), we can use CreateHardLink() which is more or less the same thing, with 2 limitations : it works only with Windows 2000 or above, and only with NTFS. Instead of
if (link (filename, bakfile) < 0)
we can do
if (CreateHardLink(bakfile, filename, NULL))
guarded by _WIN32, or alternatively:
#ifdef _WIN32
static int link(const char *oldpath, const char *newpath)
{
if (CreateHardLink(newpath, oldpath, NULL))
return -1;
else
return 0;
}
#endif
so that the code is not modified, and windows.h should be included like that:
#ifdef _WIN32
#define _WIN32_WINNT 0x0500
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#endif
about chown, maybe the following link can be of some help :
http://wwwthep.physik.uni-mainz.de/~frink/chown/readme.html#concept
I completely forgot : Windows does not have langinfo.h, but iconv can be installed. I didn't find any clean way to disable the use of iconv in the configure options and my installed iconv library is always found.
Maybe the option --disable-iconv should be added. Currently, i edit config.h...