views:

356

answers:

1

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:

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

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

A: 

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.

Sorin Sbarnea
Thanks for your answer. But as far as I cann see Pigwin is build with minGW and not mit MSVC: http://developer.pidgin.im/wiki/BuildingWinPidginDo you know another project which is build with MSVC and use gnugettext?
Name
I'm linking with gettext-runtime (as DLL), but I do not compile the library myself. My project is commercial and this cannot help you but I think that http://www.poedit.net can be compiled with MSVC.
Sorin Sbarnea
OK, I hadn't realized that there is a gettext-runtime package (which is not so easy to find on the GNU web site as there is no link to it in the "download"-section. It's just here: ftp://ftp.gnu.org/gnu/gettext/) and I was used to the Delphi version of gnugettext (http://dxgettext.po.dk/) where you simply compile a single complementary file with your project.
Name
I'm happy that I could help you, if this does answer your question please accept the answer.
Sorin Sbarnea
Well, I would have liked to accept your comment from Dec 16th as answer, because it is only after reading it, that my question was answered. But it is not possible to accept a comment as answer, that why I put a +1. Now that you have edited your answer (and moreover added an hint about a newer runtime) I will change that. Thanks again.
Name