<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 6: Compiling error on Windows (MSYS+MinGW</title><link href="https://sourceforge.net/p/libiptcdata/bugs/6/" rel="alternate"/><link href="https://sourceforge.net/p/libiptcdata/bugs/6/feed.atom" rel="self"/><id>https://sourceforge.net/p/libiptcdata/bugs/6/</id><updated>2010-02-18T05:45:51Z</updated><subtitle>Recent changes to 6: Compiling error on Windows (MSYS+MinGW</subtitle><entry><title>Compiling error on Windows (MSYS+MinGW</title><link href="https://sourceforge.net/p/libiptcdata/bugs/6/" rel="alternate"/><published>2010-02-18T05:45:51Z</published><updated>2010-02-18T05:45:51Z</updated><author><name>Vincent TORRI</name><uri>https://sourceforge.net/u/doursse/</uri></author><id>https://sourceforge.net09142be5366343778b3b67370a1f111a6e6f62bf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;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)&lt;/p&gt;
&lt;p&gt;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&lt;/p&gt;
&lt;p&gt;if (link (filename, bakfile) &amp;lt; 0)&lt;/p&gt;
&lt;p&gt;we can do&lt;/p&gt;
&lt;p&gt;if (CreateHardLink(bakfile, filename, NULL))&lt;/p&gt;
&lt;p&gt;guarded by _WIN32, or alternatively:&lt;/p&gt;
&lt;p&gt;#ifdef _WIN32&lt;br /&gt;
static int link(const char *oldpath, const char *newpath)&lt;br /&gt;
{&lt;br /&gt;
if (CreateHardLink(newpath, oldpath, NULL))&lt;br /&gt;
return -1;&lt;br /&gt;
else&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;/p&gt;
&lt;p&gt;so that the code is  not modified, and windows.h should be included like that:&lt;/p&gt;
&lt;p&gt;#ifdef _WIN32&lt;br /&gt;
#define _WIN32_WINNT 0x0500&lt;br /&gt;
#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
#undef WIN32_LEAN_AND_MEAN&lt;br /&gt;
#endif&lt;/p&gt;
&lt;p&gt;about chown, maybe the following link can be of some help :&lt;/p&gt;
&lt;p&gt;&lt;a href="http://wwwthep.physik.uni-mainz.de/~frink/chown/readme.html#concept" rel="nofollow"&gt;http://wwwthep.physik.uni-mainz.de/~frink/chown/readme.html#concept&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>