I'm lost in C++, please help !
#1
Posted 28 December 2005 - 09:11 AM
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
#2
Posted 28 December 2005 - 09:43 AM
Quote
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.
#3
Posted 28 December 2005 - 09:54 AM
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).
#4
Posted 28 December 2005 - 09:57 AM
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.
#5
Posted 28 December 2005 - 09:59 AM
Reedbeta said:
Thank you Reedbeta, I'm already browsing Amazon's site looking for the books you told me. :yes:
#6
Posted 28 December 2005 - 05:54 PM
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:
www.gametutorials.com
nehe.gamedev.net
www.cprogramming.com
and googlegooglegoogle!!!
:D
Good Luck!
#7
Posted 28 December 2005 - 06:55 PM
Quote
http://www.boost.org/
that library will provide a lot of the functionality you are looking for.
#8
Posted 29 December 2005 - 06:37 AM
- Me blog
#9
Posted 29 December 2005 - 07:07 AM
#10
Posted 29 December 2005 - 08:10 AM
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 ?
#11
Posted 29 December 2005 - 09:07 AM
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.
#12
Posted 29 December 2005 - 01:35 PM
Reedbeta said:
Lol, bloody Billy:lol:
#13
Posted 29 December 2005 - 01:53 PM
Reedbeta said:
-
Currently working on: the 3D engine for Tomb Raider.
#14
Posted 29 December 2005 - 03:08 PM
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++.
#15
Posted 30 December 2005 - 12:27 AM
#16
Posted 30 December 2005 - 07:08 AM
anubis said:
If you like highly templated helper libraries, Loki http://sourceforge.net/projects/loki-lib/ 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).
#17
Posted 30 December 2005 - 08:58 AM
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... :D
#18
Posted 31 December 2005 - 07:00 AM
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. :)
#19
Posted 31 December 2005 - 08:06 AM
#20
Posted 02 January 2006 - 11:30 PM
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.
-
Currently working on: the 3D engine for Tomb Raider.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












