Sign in to follow this  
Quasimojo

Problems with QTCreator and Kdevelop

Recommended Posts

I've been working on learning C++ through some simple RPG game design (I'm not naive enough to plan on an actual game resulting from it at this point). At the risk of giving myself yet another hurdle to clear in my learning process, I've decided to combine my interest in C++ with my desire to become more proficient with Linux.

I thought about changing the subject to, "The Trouble with Linux", as this is the sort of thing that has chased me away from it numerous times in the past. Simply put, I am using openSUSE and installed both Kdevelop and QtCreator, to determine which IDE I might prefer. However, in both cases, my simple "Hello, World" program failed to compile. I get the following error from the compile process in QtCreator:

No valid Qt version set. Set one in Tools/Options
Error while building project EpicDawn
When executing build step 'QMake'
Canceled build.

Naturally, I go to Tools/Options and find that there is, in fact, no Qt version specified. Instead it is specified that the Qt version is automatically detected and is set to "Qt in path". Of course, my first thought was that I merely need to add Qt to the PATH environment variable using the export command. So, I crack open my file system browser (Dolphin in my case) and execute a search for qt. I get several results, but, in adding each to the PATH, I found none helped.

So, here I am, stuck. I can't even get the simplest program to compile. What am I missing here? Any help (and patience with my n00b self) would be much appreciated.

Share this post


Link to post
Share on other sites
I also started playing around with Linux a while ago (using Kubuntu), and I had similar problems with IDEs. Eventually I found Geany. It is very lightweight in terms of features, but that's what I liked about it and it was very easy to setup and use.

Especially as you're a beginner, I think it's worth a try.

Share this post


Link to post
Share on other sites
For QtCreator, you have the executables and shared libraries right?

In QtCreator, go to Tools -> Options... -> Qt4 and make sure a version is set (4.7.0 is the latest AFAIK). For me it says Qt in PATH is not found, but I set a version manually.

Then if you have your project opened, go to Projects on the left tab. There's a list of build settings and paths, make sure it's all correct.

Thats what I know, just started with QtCreator as well...

Share this post


Link to post
Share on other sites
Quote:
Original post by Gage64
I also started playing around with Linux a while ago (using Kubuntu), and I had similar problems with IDEs. Eventually I found Geany. It is very lightweight in terms of features, but that's what I liked about it and it was very easy to setup and use.

Especially as you're a beginner, I think it's worth a try.


Thank you. I will certainly consider that. At this point, however, I'd really like to get up to speed with Qt, as it appears to be more mainstream and offers cross-platform capability.

Share this post


Link to post
Share on other sites
Quote:
Original post by Decrius
For QtCreator, you have the executables and shared libraries right?


Uh...I'm sorry, but I have to admit that I don't know that for sure. It wasn't completely clear to me what I needed to install from the list of packages returned from a YaST search. I selected the package at the top of the list that appeared to most closely indicate what I thought I needed (I can't find a way to view the packages already installed). Now QtCreator runs, but it is very possible that I need to install more packages.

Quote:
In QtCreator, go to Tools -> Options... -> Qt4 and make sure a version is set (4.7.0 is the latest AFAIK). For me it says Qt in PATH is not found, but I set a version manually.


The only option in the drop-down list is "Qt in PATH". I am not able to specify a specific version.

Quote:
Then if you have your project opened, go to Projects on the left tab. There's a list of build settings and paths, make sure it's all correct.


I see a whole lot of "make not found in the environment" in the project options. I searched my file system for qmake* and all I found was a list of .PNG files.

Share this post


Link to post
Share on other sites
Hmm, so you _do_ see "Qt in PATH"? Strange. That means it automatically picks the Qt version you installed, I had to click the plus on the right and add one manually.

Perhaps you can still add a version manually, but from your search escapades I dare to think you may not have compiled Qt yet. You should run './configure' and 'make' from the Qt directory then, I suppose... (through console).

Tell me your results. My recent experiences with Qt are quite good. I find it build pretty well, not much features that bother you, good auto-completion, smooth layout and quite easy accessibility.

Share this post


Link to post
Share on other sites
Ok, I went back into YaST and went digging for more qt packages. I located 3 or 4 packages that looked like they had to do with C++ core components, so I selected those and installed them. This involved some 60 items being downloaded and installed, including what looked like a few SUSE updates. Much of it is still a bit Greek to me.

At this point I have a QMake path specified in my project options, and I was able to build successfully. However, when I try to run the program, I get the following error:

Failed to start program. Path or permissions wrong?

Any ideas?

Share this post


Link to post
Share on other sites
I personally use KDevelop4. I honestly don't know what could be the problem to starting the program. Can you try running it from shell instead of from QtCreator. I don't have much experience with QtCreator. Maybe sure you have the following stuff installed.

libqt4-4.7.0-134.1.x86_64.rpm
libqt4-debuginfo-4.7.0-134.1.x86_64.rpm
libqt4-debugsource-4.7.0-134.1.x86_64.rpm
libqt4-devel-4.7.0-134.1.x86_64.rpm
libqt4-devel-debuginfo-4.7.0-134.1.x86_64.rpm
libqt4-devel-doc-4.7.0-136.1.x86_64.rpm
libqt4-devel-doc-debuginfo-4.7.0-136.1.x86_64.rpm
libqt4-devel-doc-debugsource-4.7.0-136.1.x86_64.rpm
libqt4-qt3support-4.7.0-134.1.x86_64.rpm
libqt4-qt3support-debuginfo-4.7.0-134.1.x86_64.rpm
libqt4-sql-4.7.0-134.1.x86_64.rpm
libqt4-sql-debuginfo-4.7.0-134.1.x86_64.rpm
libqt4-sql-sqlite-4.7.0-134.1.x86_64.rpm
libqt4-sql-mysql-4.7.0-136.1.x86_64.rpm
libqt4-x11-4.7.0-134.1.x86_64.rpm
libqt4-x11-debuginfo-4.7.0-134.1.x86_64.rpm
qt4-qtscript-0.1.0-12.4.x86_64.rpm
qt4-qtscript-debuginfo-0.1.0-12.4.x86_64.rpm
qt4-qtscript-doc-0.1.0-12.4.x86_64.rpm
qt4-x11-tools-4.7.0-136.1.x86_64.rpm
qt4-x11-tools-debuginfo-4.7.0-136.1.x86_64.rpm
libQtWebKit4-4.7.0-134.1.x86_64.rpm
libQtWebKit-devel-4.7.0-134.1.x86_64.rpm
libQtWebKit4-debuginfo-4.7.0-134.1.x86_64.rpm

In QtCreator just go to tools->options->qt4. If it's not under auto detected then click rebuild else you'll have to look for it. I don't know where qmake is located but it's usually in /usr/bin/qmake or /usr/local/bin/qmake.

I personally wouldn't bother with geany unless you don't auto completion.

Share this post


Link to post
Share on other sites
Ok, at this point, after digging through YaST again, grabbing more packages that I *think* look like they *might* be helpful (seriously, having to do so doesn't make any sense - surely there is a better way to set up a development environment), I created a simple test app and, without changing a thing, tried to compile it. I got the following error:

Running build steps for project TestApp...
Configuration unchanged, skipping QMake step.
Canceled build.
Could not find make command: make in the build environment
Error while building project TestApp
When executing build step 'Make'
Canceled build.

Here are my general QtCreator and project options:

Project Options

I really don't know how I'm supposed to determine which packages are necessary to establish a development environment. Perhaps I've been spoiled by Microsoft Visual Studio, which pretty much sets it all up for me. Honestly, if I can't figure this out, I'll probably just wipe it all out and try another distro that allows me to specify during installation that I want QtCreator and the latest C++ compiler installed from the get-go.

Thanks for any help on this.

Share this post


Link to post
Share on other sites
Perhaps "The Trouble with Linux" would have been more appropriate after all. After installing qt, QtCreator, KDevelop and the latest version of gcc++, I'm *still* missing "make"? I can't see how that can even be possible, but when I get home tonight, I'll go searching in YaST for "make" and see what turns up.

Thanks.

Btw, can anyone clarify for me the differences between qmake, cmake and make?

Share this post


Link to post
Share on other sites
CMake - It's like Autotools (Autohell)
QMake - Simplifed version of CMake/Autohell
g/make - actually does the building (reads makefile's and processes the commands)

CMake and QMake (build tools)

I use CMake because it's very beautiful and easy to use (depending on what you need CMake to do). KDE requires CMake to build it's applications. You can do platform checks/header checks/testing/creating projects files for IDE's etc.

QMake is only good for simple projects IMHO. Because you can easily just do "qmake -project; qmake; make" and have the application build. But if you need anything more complex you will need Autohell or CMake. Autotools is harder to work with (hence why it's called Autohell) and it's less cross platform usable.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this