I am trying to use gettext in a project that is build using cmake and msvc for x64. We need to integrate gettext to localize our application (as shared library). We are having troubles to get a compiled version with msvc_x64. We have tried the following options:
- Donwload from https://download.gnome.org/binaries/win32/dependencies/ the runtime and tools packages and use as suggested in https://stackoverflow.com/a/20038623. The project sucessfully finds the libraries, but fails in the link step since they are prepared for win32.
- Use a compiled version found in https://mlocati.github.io/articles/gettext-iconv-windows.html, but CMake complains about the libintl library since this compilation seems not be prepared to be use as part of other projects.
- Use vcpkg to install gettext, but the installation of libiconv (which is a dependency) fails. Additionally, I am not sure if headers and libs produced will be suitable for development.
- Compile manually as indicated in gettext README from https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz. The configure order fails with the following output:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... :
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '4096' is supported by ustar format... yes
checking whether GID '4096' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking build system type... x86_64-pc-cygwin
checking host system type... x86_64-w64-mingw32
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating gnulib-local/Makefile
=== configuring in gettext-runtime (/cygdrive/c/Users/User/Downloads/gettext-0.21/gettext-runtime)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local/msvc64' '--host=x86_64-w64-mingw32' 'CC=/home/MariAngelesSantosOli/msvc/compile cl -nologo' 'CFLAGS=-MD' 'CXX=/home/User/msvc/compile cl -nologo' 'CXXFLAGS=-MD' 'CPPFLAGS=-D_WIN32_WINNT= -I/usr/local/msvc64/include' 'LDFLAGS=-L/usr/local/msvc64/lib' 'LD=link' 'NM=dumpbin -symbols' 'STRIP=:' 'AR=/home/MariAngelesSantosOli/msvc/ar-lib lib' 'RANLIB=:' 'host_alias=x86_64-w64-mingw32' --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... :
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for x86_64-w64-mingw32-gcc... /home/User/msvc/compile cl -nologo
checking whether the C compiler works... no
configure: error: in `/cygdrive/c/Users/User/Downloads/gettext-0.21/gettext-runtime':
configure: error: C compiler cannot create executables
See `config.log' for more details
configure: error: ./configure failed for gettext-runtime
I would appreciate any advise of guidelines to be able to compile gettext-runtime for msvc_x64