Advice on developing in c++ using qt (windows/linux help)

Ghost02

Expert Member
Joined
May 16, 2008
Messages
3,749
Reaction score
125
Location
CPT
Hi guys,
I just got back to university and we have received our assignment for this semester, we have to create a game using c++ and an eternal gui library such as qt. In all previous semesters we have programmed using Java and VB.net only so c++ is relatively new to us.

The requirements are that it must be written using c++, it must have a gui and we must present it on a system running fedora. The lecturer has told us that in previous years people struggled to code it on windows and get it to work on the fedora machine. Is this a common issue?

We will be coding in groups of 4/5 and I will mostly be coding on my laptop which has a 120GB solid state drive, I have an external drive I could install Linux on. Now the question is do you guys also recommend not using windows for this and if I have to use Linux would it compile and run the same on any Linux machine? Basically I would prefer to rather use something like mint if I am forced to use a Linux distro.

Lastly, would it run fast enough on the 750GB hard drive I removed from my laptop and replaced with the SDD over USB2 or do I need to make another plan?

Thanks in advance.
 
Have you tried JUCE at all? That's cross platform. A few years back I developed extensively in Windows using JUCE, and managed to successfully build the application on Linux and Mac some time later. I think there were one or two nuances that needed to be catered for, but it was all pretty painless.
 
Have you tried JUCE at all? That's cross platform. A few years back I developed extensively in Windows using JUCE, and managed to successfully build the application on Linux and Mac some time later. I think there were one or two nuances that needed to be catered for, but it was all pretty painless.

I will look into that, thanks. We only just got introduced to C++ officially today so I will definitely be looking into has many third party libraries as possible.
 
In all previous semesters we have programmed using Java and VB.net only so c++ is relatively new to us.

In addition to the above, JUCE very much has a Java feel to it - so it's relatively easy to use.
 
You could certainly use a VM. However, Qt is a CROSS-PLATFORM framework and I find the notion of people struggling to code on Windows to be silly since I managed to code all my C++ and Qt assignments on Windows. And that was through UNISA and no lecturer helped me...

Also, you should use any distro flavour you like since the distro does not matter! Your lecturer certainly needs to be re-educated.
 
Wow your professor has not given you an easy task! Going from VB to C++ is a big jump.

My advice - concentrate on learning C++ in whichever environment you want. It doesnt really matter. C++ is more difficult to learn than platform specific differences. Learn about references vs pointers, header files, static vs dynamic linking and string manipulation at the very least. Also helpful - the difference between C++ strings and C style strings, and data structures such as vectors and arrays, as well as using iterators to access arrays.

The actual platform specific part will be easier compared to that. Look at development environments such as Code::Blocks - will probably make your life a lot easier.
 
You could certainly use a VM. However, Qt is a CROSS-PLATFORM framework and I find the notion of people struggling to code on Windows to be silly since I managed to code all my C++ and Qt assignments on Windows. And that was through UNISA and no lecturer helped me...

Also, you should use any distro flavour you like since the distro does not matter! Your lecturer certainly needs to be re-educated.

Thanks, he was just warning us to be cautious as it is a project that is meant to take the whole semester and he says that last year people ran into issues switching from windows to fedora which we have to demonstrate the program on.

Wow your professor has not given you an easy task! Going from VB to C++ is a big jump.

My advice - concentrate on learning C++ in whichever environment you want. It doesnt really matter. C++ is more difficult to learn than platform specific differences. Learn about references vs pointers, header files, static vs dynamic linking and string manipulation at the very least. Also helpful - the difference between C++ strings and C style strings, and data structures such as vectors and arrays, as well as using iterators to access arrays.

The actual platform specific part will be easier compared to that. Look at development environments such as Code::Blocks - will probably make your life a lot easier.

VB was in Information System lectures, we used Java through all the Computer Science lectures. I will definitely look into Code::Blocks.
 
I've also used Ogre3D, but I wouldnt recommend 3D unless you are already a fairly experienced programmer.
 
I've also used Ogre3D, but I wouldnt recommend 3D unless you are already a fairly experienced programmer.

So what you'd rather have him write his own scene manager and opengl renderer?
 
Well perhaps his course work calls for 3d instead of 2d.

I think he would have mentioned if it did.

Anyway, its up to the OP. If you are developing a 3D game, then yes I recommend Ogre. If not, I recommend finding a simple 2D games library.
 
I think he would have mentioned if it did.

Anyway, its up to the OP. If you are developing a 3D game, then yes I recommend Ogre. If not, I recommend finding a simple 2D games library.

Well he never mentioned 2d either ;)
 
Well he never mentioned 2d either ;)

Well the focus seems to be on C++ and interfacing with a gui library such as QT. For young students, that is complicated enough.

3D introduces so many new headaches that I dont think a lecturer would have them learn 3D at the same time as learning C++ and gui integration. Maybe advanced students who already understand C++ could, but for the majority of them, it will be out of reach. Computer graphics was an honours level course for us. Maybe they could dumb it down a little, but I still dont think a lecture would have them doing all of that at once.

Think about what you need to understand - transformations, vectors, vector transformations, the scene graph, lighting, materials, textures etc. its a lot to do to build a game.
 
Thanks for the responses so far guys, it's just a 2d game we have to create. It's more for us to learn to deal with a largish project and learn c++ with it's third party libraries. We have to code a game called abalone.
 
I would think its a problem because inexperienced students would spend a lot of time coding on windows and then inadvertently use the windows libraries. Avoid using namespaces is a start and understand what your includes do and whether they are windows specific. I do a bit of C++ using visual studio and then recompile on Unix. It's all command line batch stuff, so the GUI libraries aren't an issue, but I am aware of the pitfalls if cross-platform work.
 
Sounds like a big project ahead, but you'll learn a lot.

I don't have any experience with Qt but I do a fair amount of cross platform C++. I would recommend just using a notepad style app with syntax highlighting in Linux. You can use Eclipse but it really is a dog, if you're used to visual studio then I'm afraid you'll have to get out of the mindset of things just working.

That said though, once you get your makefiles setup it's quite quick and easy to build from the command line.

Another tip is to get checked into git early and commit often. If you're still figuring things out it's easy to lose track of what you've done, and having diffs can really save you a lot of heartache.

Memory management is obviously the big concern with C++, but smart pointers help a lot. Get up to speed with templates and the C++11 smart pointers, read about RAII and you'll be fine. Just don't fool yourself into thinking that its fine to just keep a bunch of raw pointers hanging around cos you'll be careful, because I guarantee you you won't!

If you're doing threading (if you have a GUI then you probably will), use the C++11 threads and synchronization instead of pthreads. Pthreads feels like it was designed by a committee of politicians.

Good luck!
 
Sounds like a big project ahead, but you'll learn a lot.

I don't have any experience with Qt but I do a fair amount of cross platform C++. I would recommend just using a notepad style app with syntax highlighting in Linux. You can use Eclipse but it really is a dog, if you're used to visual studio then I'm afraid you'll have to get out of the mindset of things just working.

That said though, once you get your makefiles setup it's quite quick and easy to build from the command line.

Another tip is to get checked into git early and commit often. If you're still figuring things out it's easy to lose track of what you've done, and having diffs can really save you a lot of heartache.

Memory management is obviously the big concern with C++, but smart pointers help a lot. Get up to speed with templates and the C++11 smart pointers, read about RAII and you'll be fine. Just don't fool yourself into thinking that its fine to just keep a bunch of raw pointers hanging around cos you'll be careful, because I guarantee you you won't!

If you're doing threading (if you have a GUI then you probably will), use the C++11 threads and synchronization instead of pthreads. Pthreads feels like it was designed by a committee of politicians.

Good luck!

Check out bitbucket.org :) It offers 5 free private repos. Download and install Visual Studio 2013 Express and use its built-in Git (GUI) to upload your work to your bitbucket account. It's pretty fast and hassle-free :D
 
Check out bitbucket.org :) It offers 5 free private repos. Download and install Visual Studio 2013 Express and use its built-in Git (GUI) to upload your work to your bitbucket account. It's pretty fast and hassle-free :D

I think you mean 5 free users and unlimited repos...
 
Top
Sign up to the MyBroadband newsletter
X