Thought you might like to ssee C++0x support for various compilers. Here is a list for GCC, or you can check out this comparison, which features many of the major compilers: Digital Mars’, Intel’s, Microsoft’s, IBM’s and, of course, GCC.
You’ll see that GCC has better support than many, which is in fact why I’ve recently switched from Microsoft Visual Studio to Code::Blocks and/or Qt Creator. I might post a little more about my experiences thereof at a later date. In particular, notice that both MSVC and GCC support long long and nullptr (about which I posted late yesterday). Indeed, long long has unanimous support across all the compilers mentioned in the chart.
And what about the last part of the title? Well I’ve been continuing to say C++0x (and probably will still do so), but as we can expect it’s release sometime this year, I guess I should start saying C++11. Ah well, I probably won’t. That is all.
In this tutorial I’m going to show you how to build the SFML 2.0 binaries from the source using NMake, that is the Visual Studio make utility. Here is a Windows batch file which should build SFML for you. Of course, it’s best to read the tutorial anyway as it will introduce you to CMake and NMake – two very useful development tools.
Read on for the textual tutorial. Even if you watch the video, it’s worth a look as we will be using console commands.
Hello, and welcome. Today we’re going to discuss windowing and video modes in more detail. That is, we shall see how we can manipulate windows, and control their attributes. Also, of course, we discuss video modes, and how we can best use them.
If you haven’t yet looked into C++0x, then you really should. While many of the features aren’t of course yet provided by compilers, various vendors seem to have started adding some – I know for a fact that Visual Studio has a fair few. If you want to read about the new standard, Bjarne Stroustrup’s FAQ isn’t a bad starting point.
You know the C++ auto keyword? The somewhat pointless one which is the default storage specifier anyway? Well in C++0x, the keyword has been re-purposed and now serves a more useful role!
(Remember, this is a feature of the upcoming standard, so it won’t necessary be widely supported yet. However, I have successfully compiled all the code below – apart from bits specifically designed to create errors – in both MSVC and MinGW.)
Consider the following code. Read more…
|Note: this tutorial is deprecated. Please take a look at one of my new ones, either for Visual C++/NMake (Windows), MinGW (Windows) or GCC/Make (Ubuntu/other Unix).|
Otherwise, I shall outline the necessary steps here, before providing a few more details where necessary.
- Download CMake from the website, or go straight to the download page.
- Download the SFML 2.0 source, unzip the file, move it to an accessible location and rename the folder.
- Create a solution file for your IDE using CMake, setting BUILD_SHARED_LIBS to TRUE.
- Take note of the value of STATIC_STD_LIBS, as you must link the C runtime to your project in the same manner as it is linked to the SFML binaries
- Open the solution file in your IDE and build SFML 2.0 in Debug and Release configuration (if your IDE supports multiple configurations).
- Repeat steps 3 & 4, with BUILD_SHARED_LIBS set to false.
- If your IDE does not support multiple configurations, repeat steps 3 – 5, setting.
- Copy and paste the resulting libraries to a better location: put them all in a lib subdirectory of your main SFML 2 directory: c:/sfml/sfml2.