Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am a total beginner in C++ and programming generaly.

I have watched a couple hours of C++ tutorials and read a lot about it (Can anyone recommend some tutorials?), but what I've come across and couldn't understand was Libraries.

I want to develop games in C++ (I think, it seems the most interesting at the moment). I can understand that I need a library for game programming in C++, but I don't know much about libraries, what specifically a library is, or where to find these libraries.

Thank you for your time. This is my first question here. I apologize if it wasn't a proper question for this website, or if the english was bad. I still hope you can give me some kind of answer and/or reponse.

share|improve this question

closed as off topic by Josh Petrie, Tetrad Jan 25 '12 at 19:12

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
Well, lua is indeed very good, but not all games need scripting. For example, you'll make an tetris game, where will you need scripting? You can say one or other things, but of course, you can do all these hardcoded. But if you need a big game that needs flexibility and scripting systems(that im afraid you answer yes, because as you said, you're not very familiar with programming) then go for it, but its a little complicated to manage. –  Gustavo Maciel Jan 8 '12 at 21:07
1  
I would suggest taking a look at this question. Ought to help you get started on game programming in C++ and introduce you to a couple of libraries. –  Mike C Jan 9 '12 at 1:33
6  
"I am a total Beginner in C++ and programming generaly." OK, stop right there. If you're a total beginner at programming, then the first thing you should learn is, well, programming. If you really want to make games, you're going to need to learn how to program something. And you need that first, not while you're also learning the details of game development. –  Nicol Bolas Jan 12 '12 at 21:17
2  
Welcome to the site! You really have two distinct questions here (asking about C++ libraries and asking about embedding Lua), which are fairly different. You may want to edit your question to make it more focused. I would recommend removing the Lua bits as they really are a more advanced topic -- you should learn to program first. –  Josh Petrie Jan 25 '12 at 16:09
1  
I removed the question about Lua, please post it seperately. I've done this so that your question doesn't get closed, because it already has one close vote on it. I'll answer about libraries below. –  Nick Wiggill Jan 25 '12 at 18:53

2 Answers 2

C/C++ libraries are modules of already-compiled code which are accessed through code you will write.

For example, TinyXML is a library that provides a lot of the functionality you would need to parse XML data, allowing you to work with XML without having to write your own parser.

Libraries come in two different flavours: static libraries and dynamic libararies.

  • A static library is specifically used at compile time, which means the libary must be present in the correct location (often but not always somewhere in your project folder) when you want to compile your C/C++ application, since it is compiled into the executable, and indeed, the compiler knows it must be there and will not compile without it. Under Windows, static libraries are usually suffixed .lib, while under the *nixes (includes Android, iOS, MacOS), they are suffixed .a.

  • A shared library is only required to be present for use at runtime. Which means you can compile your code without it. Since a shared library is not actually a part of your application's code (although your application may need it to run without failing), there is a certain overhead, however negligible, in accessing shared libraries (and it is downright negligible). When you run your favourite games, you will often see DLL files hanging out in the game's root folder, beside the executable. Those are shared libraries which the executable will need to use when you run it. Under Windows, shared libraries are .dll. Under the *nixes, they are .so. There are many differences undoubtedly, but the principle is the same, and most of the time from a coder's point of view they are not noteworthy.

Compiling libaries is another matter, which you can research once you've written a few simple programs in C or C++ and understand the bigger picture a little better. But generally speaking, it isn't too hard and is much like compiling an executable, only the code gets compiled into a non-executable file instead.

share|improve this answer

I suggest Programming Game AI by Example, you can free download C++/Lua sources of book examples

share|improve this answer
1  
This doesn't really look like a beginner-focused text at all. –  Josh Petrie Jan 25 '12 at 16:10
    
Agreed, it starts out with a trig review then implements a finite state machine in the first couple of chapters. Great book, but prior C++ experience is necessary. –  michael.bartnett Jan 25 '12 at 17:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.