title: Compiling GDAL/OGR with MinGW on Windows
body: <p>I've been trying to link the GDAL library to qt-creator this last week, but have been having problems compiling the library in order to correctly link it.
  I am getting this error</p>
  
  <pre><code>libtool: link: g++ .libs/gdalinfo_bin.o -o .libs/gdalinfo.exe  -L/local64/lib /c/gdal-2.1.0/.libs/libgdal.a -lodbc32 -lodbccp32 -lz -lpthread -lws2_32
  C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/lib/../lib/libiconv.a(localcharset.o):localcharset.c:(.text+0x8): undefined reference to `__imp_GetACP'
  collect2.exe: error: ld returned 1 exit status
  make[1]: *** [gdalinfo.exe] Error 1
  make[1]: Leaving directory `/c/gdal-2.1.0/apps'
  make: *** [apps-target] Error 2
  </code></pre>
  
  <p>After having so many problems with the compiler, I am unsure whether this is a problem with setup or whether I need to reconfigure something in the gdal library for windows/mingw consumption. </p>
  
  <p>Can anyone help me with this?</p>
  
  <p>EDIT: This may causing the problem, although I am unsure how to fix it</p>
  
  <pre><code>*** Warning: linker path does not have real file for library -lz.
  *** I have the capability to make that library automatically link in when
  *** you link to this library.  But I can only do this if you have a
  *** shared version of the library, which you do not appear to have
  *** because I did check the linker path looking for a file starting
  *** with libz and none of the candidates passed a file format test
  *** using a file magic. Last file checked: C:/MinGW/mingw64/x86_64-w64-mingw32/lib/libz.a
  *** The inter-library dependencies that have been dropped here will be
  *** automatically added whenever a program is linked with this library
  *** or is declared to -dlopen it.
  
  *** Since this library must not contain undefined symbols,
  *** because either the platform does not support them or
  *** it was explicitly requested with -no-undefined,
  *** libtool will only create a static version of it.
  </code></pre>
  
  <p>Previous attempt lead me to believe that I needed the MinGW-64 version which was not designated by the GDAL instructions, so I used <a href="http://ingar.satgnu.net/devenv/mingw32/local.html" rel="nofollow">this</a> tutorial to modify MinGW for 64 bit libraries</p>