I must admit that it is much harder than I would have thought. I'm coding for a long time with several languages (Java, Perl, Php) and I was thinking that C++ wouldn't be such a big deal.

It is not that I don't know how to code in C++, what bothers me is the libraries. I mean, with Perl (CPAN), PhP or the Java API, I have a set of standard classes/libraries that saves me a lot of time managing data streams, I/O, arrays, strings processing... With C++ it's like starting from scratch, I know that there are hundreds of C++ libraries out there but I just don't know what do I need and which one should I use.

That's like compiler and linker settings, pragmas, symbols... these are just chinese to me. I found a tutorial for just creating a window, it took 2 pages long and for most of the code, I don't know why it is here.

When I see myself stuck with such a newb problem, I start thinking to myself that building my own little game (even just a pacman :lol: ) is out of reach.

I bought a couple of books but most of the time they rely heavily on VC++ and MFC when I'm more interested in using standard libraries (I would like my programs to work on both Win and Linux).

Do you guys know any site proposing good tutorials for C++, I'm not even thinking about coding with Ogre, just basic tutorials for creating windows, configuring your compile and linker flags and symbols, dealing with windows events....:surrender

roel
—
2005-12-28T09:43:38Z —
#2

Do you guys know any site proposing good tutorials for C++, I'm not even thinking about coding with Ogre, just basic tutorials for creating windows, configuring your compile and linker flags and symbols, dealing with windows events....

Maybe you should take an other path: first master (a bit of) the language itself, then go for things like compiler/linker flags, windows and events. The latter two aren't even native C++ things, they are just systems that can be used with C++. The console screen is enough for mastering the language, imo.

Reedbeta
—
2005-12-28T09:54:25Z —
#3

I would pick up a copy of The C++ Programming Language by Bjarne Stroustrup. This will give you a reference to the language, and a little bit about the standard libraries. The C++ Standard Library by Nicolai Josuttis will go into more depth with those libraries, which are very useful. Amazon has a nice discount for buying these two books together. Alternatively, C++ In a Nutshell is a more succinct (and cheaper) introduction to the language and its libraries.

For information on setting up compiling options, you'll have to consult the docs for your specific compiler. If you are using Visual Studio, most of the options are fine left at their defaults. You just create a project, type in your code and click build.

I would recommend, so long as you're a beginner with the language, to stay away from windowing systems and just write console programs. When you're ready, if you're using Windows, then Petzold's Programming Windows is the classic reference that you can consult when you have a solid grasp of C++ (which shouldn't take long given your experience in Java). Also, learning C# (which is a Java-like language) and Windows Forms is probably a better way to develop serious Windows apps, as doing anything more complicated than a window with a menu bar and some dialog boxes gets rather hairy in C++. However if you're looking to do games then C++ is more likely to be the right language (though C# has also been used for games).

snikes
—
2005-12-28T09:57:22Z —
#4

I know the C++ language because I used it a bit (I've done a console library many years ago, but that didn't involved any library just basic console I/O methods) and languages like Java and PhP rely heavily on the C language structure.

My problems begins with flags and, as you said, what is not native C++ things.

Everytime I find tutorials about C++, it seems like the authors consider that the reader already masters compiler/linker flags and widely used libraries.

Thank you Reedbeta, I'm already browsing Amazon's site looking for the books you told me. :yes:

damn
—
2005-12-28T17:54:59Z —
#6

When i started programming, i went streight to using and learning C++, and found myself understanding very little for a while...

The trick is, you just need to know where to find the best tutorials on the net for programming with C++.

You said something about creating a window takes 2 pages of code or something... soz, im too lazy to quote... Its not all true... C++ has many more advantages than disadvantages, and hundreds of ways to programme one thing, like a window for instance... Ive seen a window programmed in +/- a half a page and many might have seen even less lines used. I think one might say that it depends on the technique you use?! :blink:

It is not that I don't know how to code in C++, what bothers me is the libraries. I mean, with Perl (CPAN), PhP or the Java API, I have a set of standard classes/libraries that saves me a lot of time managing data streams, I/O, arrays, strings processing... With C++ it's like starting from scratch, I know that there are hundreds of C++ libraries out there but I just don't know what do I need and which one should I use.

that library will provide a lot of the functionality you are looking for.

bladder
—
2005-12-29T06:37:05Z —
#8

yep, boost is the "bigun" in the c++ world, boost and the stl (which comes with you standard library). It's mostly the libraries from boost nowadays that get considered for being put right into the c++ standard right?

Btw, while browsing the Amazon site for the "Programming Windows" book I found a customer comment, a guy programming on window since 97, who pretends that Microsoft is willing to push VC++ on the .NET plateform and that in a close future every single C++ code pretending to run on windows will have to rely on .NET.

What do you think of this comment ? If true, if your aim is to create game, will you have to use .NET ?

Reedbeta
—
2005-12-29T09:07:46Z —
#11

Microsoft is certainly pushing .NET hard. However, Windows operating systems will be able to run "native" C++ code for a very long time yet. And actually, C++.NET has already been deprecated (MS are no longer supporting it). They recommend using C# or Visual Basic to develop .NET applications.

Developing games using .NET is likely to be rather awkward for the near future, however. Interfacing with Direct3D or OpenGL requires writing "unmanaged" code, effectively non-.NET code embedded into a .NET application.

Microsoft is certainly pushing .NET hard. However, And actually, C++.NET has already been deprecated (MS are no longer supporting it).

That's nonsense, "Managed C++" is deprecated, but they now have C++/CLI (a by ECMA approved international standard!), which is curretly the .Net flagship. If they are no longer supporting it, why would they bother creating a whole new international standard and compiler support for VS2005?

kariem2k
—
2005-12-29T15:08:33Z —
#14

Hi Yes there is managed c++ it is c++ but with support to all .Net concepts like "Common Language Infrastructure (CLI)" ,also there is boost library. also for GUI instead of "managed c++" which is the easiest you can use WXWidgets it is GUI api for c++.

Reedbeta
—
2005-12-30T00:27:05Z —
#15

Oh, I wasn't aware of that. I thought Managed C++ and C++.NET were the same thing.

If you like highly templated helper libraries, Loki [EMAIL=""][http://sourceforge.net/projects/loki-lib/[/EMAIL]](http://sourceforge.net/projects/loki-lib/[/EMAIL]) is one of the best. Written by this guy http://erdani.org/.

But I wouldn't suggest template libraries to anyone new to C and C++ hehe.

With something like Python/Perl/... it's all about giving you the toolset in the language, but with C/C++ it is all about defining your own toolset from a basic language (many want C++ to head the route of the formor hence libraries like boost).

snikes
—
2005-12-30T08:58:26Z —
#17

So much to learn...

I know nothing about templates, I remember to have read something about STL but that's all.

Concerning the "Managed C++" and CLI/C++, I must say that I can't see what you're talking about. I found that Microsoft is proposing a free version of Visual C++ with .NET support, but I can't see how it is working differently from a "standard" C++ application. Is the program including .NET libraries, is the program builded with a special .NET compliant compiler/linker ? Is "managed C++" like a java/cs code, I mean compiled into some kind of bytecode and then interpreted via CLI...

Damn I sound so clueless...

eddie
—
2005-12-31T07:00:32Z —
#18

Visual C++ is just an IDE with a set of compilers/linkers underneath it.

CLI/C++ I don't know enough about to be authoritative on, but when people say "Managed code", they generally mean something that's garbage collected, and often reference counted.

That said, I haven't worked with this much, so I'm sure someone *cough* .oisyn *cough* will correct me.

Reedbeta
—
2005-12-31T08:06:58Z —
#19

.NET programs consist of a bytecode (called MSIL) which is stored in an ordinary EXE file. When you execute it, a JIT (Just-in-time) compiler translates it from bytecode to machine code. All the .NET languages (VB.NET, C#.NET, C++.NET, etc) compile to the same kind of bytecode, which is why you are able to use class libraries built in one language with programs in another language. The standard libraries, which comprise the CLI (Common Language Infrastructure, damn MS for stealing that acronym from Command Line Interface!) are also useable the same way across all the languages.

oisyn
—
2006-01-02T23:30:02Z —
#20

"Managed C++" and "C++/CLI" are both C++.Net, so you're compiling to .Net bytecode. The difference between the two is the specific .Net syntax used in C++ code. Managed C++ was the syntax used in VS.Net 2002 and 2003. It uses a lot of ugly reserved words with double underscores.

With C++/CLI, Microsoft standardized a new C++ interface for the common language infrastructure with syntax constructs that blend very well in the language. It has whole new symbols for references and pointers to managed (.Net) objects, and a lot of built-in template-like features to interface with managed objects from unmanaged code (like converting a reference to a managed object to a native C++ pointer) and vice versa.