简体   繁体   中英

CONFUSED — c++ 3rd party library, new to c++

(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.

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).

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM