linker - Link error with GetACP under mingw64 (mingw-builds) -
i trying build gdal-1.10.0 (http://trac.osgeo.org/gdal/wiki/downloadsource) using mingw64 (from http://sourceforge.net/projects/mingwbuilds/files/host-windows/ x64-4.8.0-release-posix-seh-rev2.7z). have compiled gdal-1.10.0 under standard mingw (32-bit) version without problem.
the reason have switch mingw64 standard 32-bit mingw distribution not support c++11 features std::thread
, , (i suspect) other features well. linking error in end telling me about
undefined reference '__imp_getacp'
(or different decorated name if use 32-bit variant mingw64/mingw-builds). btw, tried different versions of mingw64, including 64-bit, 32-bit, seh, sjlj, gave same error getacp()
.
i did homework , found instructions similar compilation task: http://www.gaia-gis.it/spatialite-3.0.0-beta/mingw64_how_to.html#env according above website, seems suggest problem has wow64 , correct version of windows dll files cannot used because windows automatically determines depending on whether 32-bit or 64-bit application making call. supposedly problem mingw64 because compiler gcc 64-bit msys hopelessly 32-bit.
but since tried 32-bit versions well, above not seem explain error. more, tried in dirty way comment out calls getacp()
, because don't care code pages , purposes. strangely enough, compilation ok (on fresh source getacp()
's commented out), same link error still reported. checked libkernel32.a
, libiconv.a
in lib
folder, , followed instructions in blog above copy dll's out c:\windows\system32
, place them in mingw subfolders appropriate renaming. link error remains. stopped hacking after spending 2 days on without success. can't understand why entire source-code not contain single call function , still getting link error.
can explain might have caused issue between gdal , mingw64, , how fix it?
also, general question mingw64 is able support posix functions? see package names such x64-4.8.0-release-posix-seh-rev2.7z, remember mingw people said never support full posix.
p.s. testing on windows server 2008 r2, 64-bit.
update: complete steps building gdal-1.10.0 under mingw64 (mingw-builds) are:
$./configure
then, edit gdalmake.opt, find gdal_root , replace cygwin drive format dos/mingw format, e.g. change:
gdal_root = /d/temp/build/gdal-1.10.0
to
gdal_root = d:/temp/build/gdal-1.10.0
replace
config_libs = $(gdal_root)/$(libgdal)
with
config_libs = $(gdal_root)/$(libgdal) -liconv
finally,
$ make && make install && cp apps/*.exe /usr/local/bin/
i have accidentally encountered same problem. maybe mingw bug or bad configuration files, solution add -liconv end of linker flags, example, replace
config_libs = $(gdal_root)/$(libgdal)
with
config_libs = $(gdal_root)/$(libgdal) -liconv
in gdalmake.opt file (found searching mingw directory getacp in files).
Comments
Post a Comment