title: Compiling a library (redland) in Cygwin using gcc and using the output in Visual Studio (c++)
body: <p>I'm currently trying to compile redland (librdf <a href="http://librdf.org/" rel="nofollow">http://librdf.org/</a>) under Windows. According to their website it should build under Windows. As i don't want to spend my time fixing the .sln I thought about compiling librdf (and the necessary projects) in cygwin and then use the library in visual studio. </p>
  
  <p>So my question is:
  Is it possible to use librarys compile in cygwin in windows application? And if so how?</p>
  
  <p>As I am a windows developer I don't know if there is any difference from the created .a files to .dlls. I already read up to the topic and it will be necessary to include the cygwin1.dll in the project but this won't be a problem.</p>
  
  <p>Or does anyone have any better idea how I can get redland compiled as windows dlls?
  I thought about using mingw but until now I didn't manage to compile it.</p>
  
  <p>Any help will be appreciated.</p>
  
  <p>Thanks</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Thanks to the help of Yaakov (And his pretty cool cygwin ports) I meanwhile managed to compile raptor (which is a prerequisite for librdf).
  All I had to do was include another argument for configure: --with-xml2-config=/usr/x86_64-w64-mingw32/sys-root/mingw/bin/xml2-config</p>
  
  <p>Now I'm trying to compile rasqal which is another requesite and is also depending on raptor2.
  For it to work I had to export PKG_CONFIG_PATH="/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/" for pkg-config to find the correct raptor installation.</p>
  
  <p>So configure for rasqal worked but when I try to make it I get the following error:</p>
  
  <pre><code>Making all in src
  make[1]: Entering directory `/home/Stefan/workspace/rasqal/src'
  make  all-am
  make[2]: Entering directory `/home/Stefan/workspace/rasqal/src'
  /bin/sh ../libtool  --tag=CC    --mode=compile x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H  -I.   -DRASQAL_INTERNAL=1   -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/raptor2       -g -O2   -DMTWIST_CONFIG -I../libmtwist -g -O2 -MT rasqal_algebra.lo -MD -MP -MF .deps/rasqal_algebra.Tpo -c -o rasqal_algebra.lo rasqal_algebra.c
  libtool: compile:  x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -DRASQAL_INTERNAL=1 -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/raptor2 -g -O2 -DMTWIST_CONFIG -I../libmtwist -g -O2 -MT rasqal_algebra.lo -MD -MP -MF .deps/rasqal_algebra.Tpo -c rasqal_algebra.c  -DDLL_EXPORT -DPIC -o .libs/rasqal_algebra.o
  In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/time.h:10:0,
                   from rasqal.h:116,
                   from rasqal_algebra.c:39:
  /usr/x86_64-w64-mingw32/sys-root/mingw/include/time.h:260:8: error: redefinition of 'struct timezone'
  ./win32_rasqal_config.h:62:8: note: originally defined here
  Makefile:1045: recipe for target `rasqal_algebra.lo' failed
  make[2]: *** [rasqal_algebra.lo] Error 1
  make[2]: Leaving directory `/home/Stefan/workspace/rasqal/src'
  Makefile:720: recipe for target `all' failed
  make[1]: *** [all] Error 2
  make[1]: Leaving directory `/home/Stefan/workspace/rasqal/src'
  Makefile:484: recipe for target `all-recursive' failed
  make: *** [all-recursive] Error 1
  </code></pre>
  
  <p>Which I can't get my head around I'm not really into cross compiling. 
  Can someone point me into the right direction?</p>