tags:

views:

444

answers:

4

(mingw32, windows xp) Hello, I am attempting to migrate from Java to c++. I am confused and frustrated about finding, installing, and compiling non-standard c++ libraries. in Java it's so convenient they stuffed every functionality and documentation ever needed in java's standard api. Is there a list of essential c++ library such as Threading, gui, networking, image\ audio processing, xml, etc.etc. in one place? or possibly, offered as a single package?

I tried installing QT library for weeks and it wont even compile. in Java i used to learn by trial-and-error to learn new aspect of functionality, but that would be impossible if i can't fetch and run new api in the first place.

please, i need your suggestion, originally i wanted to break free of Java's abstraction, but now i just want to be able to use c++ before I decided shooting myself in the head.

A: 

Sorry to answer a question with another question, but what's your motivation for moving from Java to C++?

The language you select should be the one that most appropriately solves the problem. If you've always found Java so convenient for the sorts of things you do, and C++ is so problematic for you, why is C++ a priority?

Andrew
+2  A: 

The C++ standard library is extremely light. It contains nowhere near the functionality offered by the Java runtimes or by the .NET CLR.

The Boost libraries add a whole bunch of functionality to C++, but not much (if any) in the area of user interface.

For UI, there's the question of which platform you're targetting. If it's Win32, then you can use the straight Win32 API (mostly designed for C, but there are some C++ wrappers for parts of it). If you want cross-platform, then you're looking at QT or GTK (although there are others).

But, as Andrew already said: "why do you want to learn C++ anyway?". Don't get me wrong: I program in C++ for a living, and actually enjoy it (although I'm beginning to suspect a case of Stockholm Syndrome). If I had to start again, I'd go with a more modern language and environment (Java or C#; or Ruby or Python).

Roger Lipscombe
You're wrong about the lack of networking libs in boost: there's boost::asio . It's still not Apache HttpClient sort of abstraction, but it's much better and much portable than plain sockets.
macbirdie
Cool. I didn't know that. Updated my answer.
Roger Lipscombe
That's a good answer, but only after he gets to the point he can use it. Right now, I suspect it would only confuse him further.
Head Geek
A: 

Threading, XML, Networking, some image generation, encoding and processing - boost provides those. As for XML, there's for example Arabica - it abstracts away platform-specific libraries by wrapping them with a nice standard C++ scent.

The GUI part is a different problem.

There's Qt, wxWidgets, gtk with c++ bindings (gtkmm), native libraries for each platform and their C++ wrappers (WTL is an excellent library for Win32), but as the C++ standard evolved and boost is becoming part of the standard (C++0x coming soon), there are no GUI frameworks that leverage those standard facilities and introduce their own instead. They do their job very well though.

macbirdie
As with Roger's answer, this would be helpful to him later, but not at this stage.
Head Geek
+1  A: 

My advice would be: take it one step at a time.

First, figure out how to include a pre-built library in your code. I'd recommend starting with ZLib (it's got a very easy design to work with and it's also a useful tool to have available). Once you've got the pre-built library working, remove it and try compiling ZLib from the source code. Ask on Stack Overflow if you need help at any point, we'll get you through it.

By the time you get that working, you should have all the knowledge you need to get Qt compiled and installed too.

Head Geek