是否可以将 GNU gettext 与 MS Visual C++ 一起使用?有人知道在哪里可以找到在 Visual C++ 下编译的示例项目吗?
更新:
感谢 Sorin Sbarnea 的评论,帮助我将所有内容整合在一起:
我已经习惯了 Delphi 版本gettext ,您只需使用您的项目编译单元 gnugettext.pas ,这就是为什么我只是尝试使用我的 MSVC 项目编译 gettext.h 。它可能适用于其他 C++ 编译器,但不适用于 MSVC。
GNU gettext 解释了如何通过使用预编译的 DLL 通过 MSVC 来完成此操作。但没有指向 DLL 的链接,并且这些 DLL 也不在主下载中。它们必须从 ftp 站点 单独下载。您将需要 2 个 dll 文件:
如果您需要工具从 exe 中提取字符串,您还需要:
我还没有在 MSVC 上尝试过,但现在我认为它会起作用。
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.
发布评论
评论(2)
显然我知道很多项目都在 MSVC 中使用 gettext。另外,如果您正在考虑在商业、闭源项目中使用 GNU gettext 运行时,请注意运行时库是 LGPL。这主要意味着您需要开源对 gettext 运行时库(而不是您的代码)所做的任何修改。
另外,gettext 实用程序使用 GPL 许可证 - 但这并不那么重要,因为您不需要/不想分发它们。
对于 Win32,您应该从 Gnome FTP 获取 gettext 运行时,因为构建比 GNU 的版本更新。
关于开源软件,请查看 PoEdit。
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.
GNU gettext-0.18.3.2 Visual C++(MSVC) 运行时下载,它对我来说效果很好。
GNU gettext-0.18.3.2 Visual C++(MSVC) runtime download, it works well for me.