tags:

views:

2402

answers:

23

I've been out of the C++ game for about 10 years and I want to get back in and start on a commercial app. What libraries are in use these days?

  • User interface (e.g, wxWidgets, Qt)
  • Database
  • General purpose (e.g. Boost, Loki, STL)
  • Threading
  • Testing
  • Network/sockets

I looking to be cross-platform compatible (as much as possible out-of-the-box).

What libraries to do you rely on? What features do they provide that make them "indispensable"?

See my answer below for a summary.

+34  A: 

Qt is a great addition with the new LGPL licensing model which allows it to be used in commercial software free of charge.

It's the perfect place to start with a new cross platform project.

Brian R. Bondy
+39  A: 

STL: Standard Template Library. Don't leave home without it.

JaredPar
If that isn't in your C++ system already, get a more modern one.
David Thornley
True, but there's a difference between STL being available, and STL being part of your toolbox (as in something you actively use)
jalf
+52  A: 

Boost is a huge one (well, technically a bunch of big ones).

Harper Shelby
It is strange as Boost already was mentioned in the question.
Mykola Golubyev
Well, it's mentioned as an example, but I think it's a critical modern C++ library set.
Harper Shelby
And even if it wasn't answered in the question, I barely see any C++ question that aren't answered by saying "Boost".
tstenner
@tstenner: LOL, true... Boost does get name-dropped plenty. :) But deservedly so IMHO.
j_random_hacker
+6  A: 

My all time favourite: Qt. It is cross-platform, provides fantastic features for UI, multi-threading, Database and general purpose functionalities.

Donotalo
+4  A: 

Qt is quite simply excellent. Its cross platform, and has modules for pretty much all the things you would want to do in an application: networking, database, ui, xml and a bunch of other stuff.

Naren
+4  A: 

CppUnit for unit testing and test driven development

Andrew Stein
+10  A: 

Adaptive Communication Environment (ACE) is a cross-platform OO network programming toolkit written in C++. Wikipedia has a good description.

ajanicij
Wow, cool.. thx!
Ryan Emerle
+4  A: 

http://loki-lib.sourceforge.net/ might also be good addition.

It's another template library, which introduces typelists, and implementations for various design patterns.

I never used it, but I read Alexandrescu's book to get a better understanding of templates.

Ronny
Loki's ScopeGuard will **change your life**. Seriously. You'll be stronger, faster, and more attractive to the opposite sex.
j_random_hacker
+3  A: 

familiarity with stl and boost are essential to any serious c++ developer. I've heard good things about Qt, but didn't know it was free for commercial use until the post above. Thanks Brian R. Bondy.

Jim In Texas
+4  A: 

Personally, Boost and STL are must haves. I would also take a look Poco.

D.Shawley
+2  A: 

STL, Boost, and QT makes a great combination.

Zifre
+8  A: 

Google Mock and Google Test for Mock Objects in C++ and Unit Testing.

Grant Limberg
+8  A: 

On Windows...

ATL for COM development WTL for user interface

FrodoH
+18  A: 

Sorry for repeating some of the stuff already written, but:

(Should at least get you started)

Cwan
Thanks for the summary
Ryan Emerle
+7  A: 

The STL (Standard Template Library) should be provided by all decent C++ compilers. If you don't know it, you should. If you think you don't need it, it's fine if you have good reasons, but you have to know it first anyway.

Boost ( http://www.boost.org ) is a big set of libraries that is complementary to the STL. Most of the STL additions are first provided in Boost before getting to the official standard library status. Most of the time, you find in Boost what you need when it's related to general algorithms/structures. The main exception is GUI lib.

A tiny alternative to Boost is POCO ( http://pocoproject.org/ ). It provides some of the most essential libraries that are already in Boost, but implemented in another way, easier to read an learn if you're not yet a C++ specialist. It's not as "complete" (or "with as much variety" should I say) than Boost, but it's sometime interesting. Learn a bit about it to know your choices.

For GUI, as other suggested, in C++, QT might be the more useful GUI (and other tools) library at the moment. Alternatives are wxWidgets and GTK (gtkmm) for the more known.

All those libraries are cross-platform.

Klaim
GTK+ isn't really for C++, but there is gtkmm.
Zifre
That's right, I this this.
Klaim
+32  A: 

Cross-platform libraries that are free for commercial (or non-commercial) applications

Feel free to expand this list

Ryan Emerle
Qt could fit into a lot of these categories, not just UI.
Brian R. Bondy
@Brian: I'd say it can fit in all of them except for 3D.
Lucas Cardoso
FMOD isn't free for commercial apps. irrKlang is one alternative (for games)
kibibu
what do you think about StlSoft?
Gohan
I hope we're not expected to use all those libraries all the time. ;)
jalf
+2  A: 
  • Boost
  • GTK -> GTKmm
PoweRoy
A: 

Ogre, SDL, ICE

raspi
+4  A: 

CGAL is an excellent c++ library for computational geometry

www.cgal.org

crocpulsar
+1  A: 

My toolset:

  • STL
  • Boost (mostly scoped_ ptr, shared_ ptr, lexical_ cast, noncopyable, bind and function)
  • Poco (Foundation, Net and XML)
StackedCrooked
+3  A: 

I agree with the general consensus that boost, STL and QT are probably at the top of the general list.

I often need a decent cross platform http library and I've always had good luck with libCurl. I believe QT has some of this functionality as well, but if QT doesn't cut it for some reason, definitely have a look at libCurl.

Mike Ellery
+1  A: 

In regards to "Cross-platform libraries that are free for commercial (or non-commercial) applications", POCO should be added to Networking, Threading and Logging categories.

Alex
A: 

Besides all the great libraries already listed, I find the combination of xerces for XML (including XSD validation) and xalan for XSLT to be useful (xalan is built on top of xerces). AFAIK neither QT or POCO have XSLT functionality (unless it's been added since I last used them).

Ralf