Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use GNU gettext with MS Visual C++?

Is it possible to use GNU gettext with MS Visual C++? Does someone know where to find a sample project that compiles under Visual C++?

Update: Thanks to Sorin Sbarnea for his comments which help me to put all the pieces together:

I'm used to the Delphi version of gettext where you simply compile the unit gnugettext.pas with your project, that is why I was simply trying to compile gettext.h with my MSVC project. It might work for other C++ compilers but not with MSVC.

The FAQ of GNU gettext explains how to do it with MSVC by using precompiled DLLs. But there are no links to the DLLs and these DLLs aren't in the main download. They must be downloaded separatly from the ftp site. You will need 2 files for the dlls:

  • gettext-runtime for win32
  • libiconv for win32

And if you need tools to extract the strings from the exe, you also need:

  • gettext-tools for win32

I haven't tried it yet with MSVC, but now I think it will works.

like image 823
Name Avatar asked Dec 09 '09 15:12

Name


2 Answers

Clearly I know lots of project that are using gettext in MSVC. Also if you are considering using GNU gettext runtime in a commercial, closed-source, project be aware that the runtime library is LGPL. This means mainly that you need to open source any modification you may do to the gettext runtime library (not your code).

Also, gettext utilities are using GPL license - but this is not so important because you don't need/want to distribute them.

For Win32 you should get the gettext runtime from Gnome FTP because the build is newer than the one from GNU.

Regarding open-source software take a look at PoEdit.

like image 66
sorin Avatar answered Nov 13 '22 23:11

sorin


GNU gettext-0.18.3.2 Visual C++(MSVC) runtime download, it works well for me.

like image 35
aslike Avatar answered Nov 13 '22 22:11

aslike