Friday, February 01, 2013

MinGW Distro - February 2013 Release

By demand the add-on libraries have been included in the main package.

Updates: FreeType 2.4.11, GLEW 1.9.0, ICU 50.1.2, libssh2 1.4.3, libgmp 5.1.0, POCO 1.4.6, SQLite 3.7.15.2, jpeg 9

MinGW-Distro-Addons.exe - 75 Mb - Full with add-ons
SHA1: dbdf784f741efa0c0aa8cb3640bbb4dcbc45b707

MinGW-Distro-Core.exe - 16 Mb - Core Components
SHA1: 97b13f4ce75dc48f536c0c350a35758373125de5

Friday, December 14, 2012

auto overused

I had recently read on an article on a programming subject not related to C++11 but which uses C++11 constructs to explain the point. It is nice to see that C++11 is being adopted this way. However one thing that scared me was the overuse of auto keyword.

const auto MAXSIZE = 10000;

for (auto i = 0; i < MAXSIZE; ++i)
{
...
}

This chills me to the bone. Why not use int or size_t? Of course this simple code doesn't show the complete threat that is the overuse of auto. But this introduces a culture where is OK to use auto everywhere.

My feeling about auto is that it is a tool best fitted for generic programming or where writing the type is difficult, complicated or impossible. Compare this:
std::vector<int> v;

for (std::vector<int>::const_iterator it = v.begin(); it = v.end(); ++v)
{}

with the better:

std::vector<int> v;

for (auto it = v.begin(); it != v.end(); ++v)
{}

but this is even better and clearer:
std::vector<int> v;

for (int &i : v)
{}


Excessive use of auto can lead code that is hard to read and to maintain. Maintenance is all about code reading. Please take care.

Sunday, December 02, 2012

Why another XML parsing library?

Some may have noted that in the December 2012 release of my MinGW Distribution I have included yet another XML parsing library: pugixml. Why this if it already has libxml2?

Well, while libxml2 is a complete, standard-compliant XML parsing library it lacks a DOM interface. With DOM it is easier to handle and to walk through the XML representation.

I have evaluated many simple to use, fast libraries: RapidXML, FastXML, AsmXML. And, of course pugixml. However pugixml is fast, has a good documentation and a DOM-like, modern interface that fits well with STL and C++11 ranged-for and lambdas. That was I was looking for.

MinGW Distro - December 2012 Release

Some people have reported that my website is down. Unfortunately depending where in the world you are the site is accessible or not. I'm investigating this issue with my hosting provider. Because of this issue and to ease the release process, this and next releases will be published here, in this blog in addition to the website.

MinGW Distro - December 2012 Release

Updates: binutils 2.23.1, Boost 1.52.0, PNG 1.5.13, TIFF 4.0.3, cURL 7.28.1, GraphicsMagick 1.3.17, POCO 1.4.5, SQLite 3.7.14.1.
New: pugixml 1.2

MinGW-Distro.exe - 43 Mb - Full
SHA1: 92d09d316c17da21c1607ba0938f260b67c8b8b8

MinGW-Distro-Core.exe - 16 Mb - Core Components
SHA1: b3ad4e5e587c915b25acbabd1fdfa0edda69d93f

Friday, November 23, 2012

Building OpenSSL applications

An user has reported problems building an application that use OpenSSL libraries supplied with my MinGW Distro. While he didn't provide further details I think his problem was related to some missing library dependencies.
Any application using OpenSSL has to link with (in this order): ssl, crypto, ws2_32 and gdi32. ssl and crypto are the OpenSSL libraries themselves. ws2_32 is the import library for the Winsock DLL WS2_32.DLL and gdi32 is the import library for GDI32.DLL. The latter is needed because, on Microsoft Windows, OpenSSL uses windows events (eg, mouse movements) as an entropy source.
If you are using a IDE (like Codelite or Code::Blocks) make sure to add those libraries to the project settings.