Jump to content

April 2017 »

23 242526272829

0 user(s) viewing

0 members, 0 guests, 0 anonymous users

Latest Visitors

- - - - -

The boring part of being a Developer or: Why I failed

4: Adsense

Soooo... this week I write again about the boring part of developing: Software Construction

If you've read my ramblings on "The seventh Circle of Dev Hell", know that I have my problems with the toolchains for C++, so this is basically part 2 of the Dev Hell, but more structured and no random sentences. Since I don't think C++ veterans have any interest in a text of my first experiences with different C++ tools. I aim this at the C++ newbie, like I am.
I don't have a lot of experience with the toolchains, all of this are the first experience I had with them, so don't take it too seriously when I write "tool xy sucks", I havent worked with them for more than a few hours.
"What are the best tools to use" you ask? None of them, they all suck.

The Problem with the C++ tools
They are old, mostly.
As I sink more and more time into everything around the coding, I see now why C# and Java use a separate RE. I suddenly like Ant + JUnit. It is just so easy to set up build scripts and tests for your platfom, that happens to work on others as well.
I am very disappointed by the tools available for C++, comparing to what is at Java/C# disposal, they are shabby.
This is managable for a C++ newbie if you get some help from tools, like Eclipse CDT that takes care of your make files.
Good for you, but if your project should be platform indipendent, so should be your makefiles (traditional makefiles aren't afaik). And here is where the pain starts, here is where you sink too much time, here is where you have to learn more than you think.
There are tools around, like CMake or QMake. CMake is fit for the job, but you don't. It isn't an easy tool to work with, at least for me, it really starts to get on my nerves.
That's why you shouldn't use C++ for your first big project. You spend so much time figuring out how everything else besides the coding works, how you install tool XY, how do you link correctly, how the HELL do you set up a good cross plattform build environment??

Setting up such an environment isn't hard, if you have experience how you do it. I would love somebody explaining to me his/her setup why it was done that way and not otherwise...

But alas, there was nothing I could find that satisfied me. So the short story: I gave up.

I decided to not go for platform indipendece, I first aim for Linux 64 bit environment. And if the unexpected happens and the game suddenly gains huge popularity, I can make the project cross platform with roughly the same amount of work. But then, it would be worth the time.

Sep 28 2012 04:00 PM
Have you tried QtCreator? I'm using it on Windows just fine, with the MinGW compiler, and it's supposed to be cross platform (and GCC is obviously cross platform), so I'm hoping it'll ease my porting to Mac OSX and Linux when I need to cross that road later.

Or, by cross platform, do you mean compiling Windows executables on a Linux machine and vice-versa?
Sep 30 2012 07:43 AM
QTCreator is one of the few IDE's I haven't tried yet. Maybe I should.
I am currently using Code::Blocks, which I am very fond of. The only thing I don't like about it is that it seems to want all source files in ./project/source and all header files in./project/include. I haven't found out how to structure my code::blocks projects differently.

Windows executable on LInux? I haven't considered this as possible for C++, the machine code is architecture dependent, isn't it? I would like to have a toolchain for compiling the same code under windows and linux.
Sep 30 2012 11:44 AM
Yes the machine code is architecture dependant. I meant using Linux to compile a Windows executable for Windows, or using Windows to compile a Linux executable for Linux. It's doable but hard.

(It's important to understand QtCreator is an IDE meant to ease development with the Qt cross-platform GUI API, but doesn't have to be used with the Qt API)

QtCreator claims (I haven't tried it yet) to be able to compile the same code on Windows, Linux, and Macintosh, if you install QtCreator on a Linux, Windows, and Macintosh machine to do the compiling.

To compile a Windows executable, use the Windows version of QtCreator on a Windows machine, and hit compile.
To compile a Linux executable, use the Linux version, on a Linux machine, hit compile (with the same code and project files).
To compile a Macintosh executable, use the Mac version of QtCreator, on a Mac machine, and hit compile (with the same code and project files).

Supposedly, anyway.

I wasn't sure if that's what you were refering to (compiling the same code on seperate machines for seperate target machines)
Or if you were asking about cross-compiling (compiling the same code on a single machine for seperate target machines. IE: Using Linux to compile Mac and Windows executables, without bothing to boot up Mac or Windows to do the compile. QtCreator doesn't handle this (it depends on the compiler, and as far as I can tell, it's not easy)

Cross platform (portable code using portable tools, but requiring you to compile on each target platform)
Cross compiling (portable code, using a single tool, compile different versions from one platform for each target platform) [difficult]

QtCreator should easily do the first (as long as you write portable code, QtCreator claims), and has some IDE support for the second, but that depends on the actual compiler. GCC/MinGW as a compiler can do that (in theory), but it's difficult to get it set up (and certainly beyond my knowledge).

I'm not good with all these GNU tools (GCC and MinGW) to be honest, so maybe a Linux user like yourself would have an easier time. GNU seems to delberitely make the tools hard to use (and in fact have admitted it at least once before).
Oct 02 2012 12:38 AM
I originally wanted a virtual pc enviroment, each building for a target platform (I am not sure if i have to build for 32/64 bit respectively). But I postphoned that task, until i actually have something to build and release.

Since I still don't have a working toolchain, so most of the project is still in my head.

I had a first look into Qt Creator, I like what I see so far. Maybe it is the Jesus IDE for C++ at last...

Note: GameDev.net moderates comments.