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.
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) runtime download, it works well for me.
Related
I want to write portable code. For this, I want to disable language extensions with the compiler flag /ZA.
Since Win32 APIs (Windows.h) need MSVC extensions, I need to remove /ZA. However, is it possible that MSVC still throws warnings if a language extension is used?
I am writing a CMake project and I want to use the language extensions only where necessary (the part of the project that is used for the Windows compilation)
I am trying to embedded some assembly code into my C++. Everything is fine when I use x86(win32) build mode, but when I switch to x64 build mode, VS2012 reports a lot of compiling errors.
I am wondering how to embed the assembly into C++ in x64 build mode?
You can, just not inline. Go to build customizations, add MASM (or YASM if you like it better - I do), then add .asm files. They will be assembled and linked in with no further effort.
It doesn't appear to be supported. Quoting from MSDN:
Inline assembly is not supported on the Itanium and x64 processors.
There is a Youtube page called "What's a Creel" or something like that. He has a fifty-something lesson course on adding assembly to C++ using Visual Studio.
I would like to find out if any kind of a Microsoft Visual package is installed during my Nsis installation (I need the Compiler from those Microsoft packages (C,C++ Compiler))
One possibility could be to have a look in the registry...but it would always be a different entry.
So far I´ve got no good solution to detect a MSVC maybe anyone else does?
Your best bet is probably to look in the registry. You could take a look at some open source build tools and see how they do it. (SCons etc.)
The other alternative would be to search all drives for cl.exe with FindFirst and friends but that could be slow and you would probably have to check the version information to filter out false positives...
I would expect the mfc to refer to the Microsoft Foundation Classes, but this still leaves the following questions:
What does the s stand for?
What does the 90 mean?
These MFC link libraries are lightly documented by Microsoft's TN033 Tech Note: http://msdn.microsoft.com/en-us/library/hw85e4bb.aspx
A quick summary about the mfcsxxx.lib files is: The MFCSxx[U][D].LIB libraries are used in conjunction with the MFC shared DLLs. These libraries contain code that must be statically linked to the application or DLL.
The "U" designates that the library is built for Unicode.
The "D" designates that the library is built for Debug.
If the number in the library is 90, then it's compiled with and for Visual Studio 2008 (VC++ 9.0)
If the number in the library is 100, then it's compiled with and for Visual Studio 2010 (VC++ 10.0)
Note that while the mfcsxxx.lib files have code that is statically linked to the output binary, they are used in conjunction with the DLL versions of MFC - when statically linking MFC, the [nu]afxcw[d].lib libraries are used (where "n" or "u" determines whether or not the library is Unicode, and "d" is used in Debug builds).
Other related MSDN pages:
Library Naming Conventions (for MFC static linking)
Naming Conventions for MFC DLLs
C Run-Time Libraries
90 is 9.0 and means it corresponds to Visual Studio 2008
I'm going to take a stab at the 's' and say it says the library supports MultiByte Character Sets (as opposed to Unicode or ANSI), but I could not find a link that directly confirmed that.
Edit:
Michael Burr is correct, the 's' indicates it is a library that is statically linked and used in conjunction with the shared DLL versions of MFC. I almost prefer the documentation for Visual Studio 2003: http://msdn.microsoft.com/en-us/library/eezxhb2t(v=vs.71).aspx where it has the DLL in the table and explains what it is for.
I'm working on a website that requires a flash mp3 player. I have absolutely no idea the procedures from messing with flash/actionscript/flex etc., however I need to edit the flash very slightly (I need to add two lines of code). There are a multitude of tutorials out there for setting up a flash (or flex or whatever) development environment but, as my needs are so simple, I'd like to go a little more light-weight than that (also, many seem outdated). I guess what I'm saying is I'm looking for a simple way to recompile some existing actionscript (command line is a plus!). Does anyone have a trick up their sleeve to accomplish this?
Download the free/opensource Flex 3 SDK. This includes an ActionScript3 compiler. Run the compiler like this:
mxmlc MyAs3File.as
There's MTASC for ActionScript 2.
You can compile it online here: http://wonderfl.kayac.com/. No mess that way.
I also wanted to say that swftools has exactly what you need. There is a swfc compiler which will compile as2 files. I would really recommend updating the source though. AS3 is much faster than AS2 and there are a lot of tools out there for example mxmlc and fcsh included in the open source Flex sdk. If you are looking for a full blown IDE there is a linux version of Flash Builder that was released as an open source port ... there are a couple other ones out there as well.
General Linux
On linux you can get the source from swftools.org.
Debian / Ubuntu
On debian / ubuntu you can run
apt-get install swftools
Mac OS X
Not exactly 'linux' but on mac OS X if you have homebrew installed you can do:
brew install swftools
Great, but how do I compile the code?
One this is installed you should have a new utility that you can use to do:
as3compile MyAs3File.as
Gotchas
Please note this is not a 1:1 replacement for Adobe's compiler - there are some things that it does not support ( see documentation, FAQ, changelog at swftools.org ) but it worked well for compiling my simple actionscript.