Jump to content

IDE for C/C++


Recommended Posts

Are you sure? I'll be glad to know how, because I liked Qt-Creator.

 

After Clicking File -> New... Under Projects I choose "C++ library" (No option for C). Next screen I choose "Shared library", and in the next screen I am required to type in Class name (Field cannot be left blank). Plus it only creates files with cpp or h extensions. So I'll be really glad to hear what I'm doing wrong and how I can create a stand-alone program in C (not a library, a simple Hello World program. From there I'll manage).

 

Well, I've actually not used Qt-creator that much since I'm used to Eclipse. But I did a small test.

 

If you choose File->New and under projects choose "Qt4 Console Application", click Next and then choose a project path and name. Click Next again and untick all selections on the next screen.

 

You now have an almost empty project, with this code in main.cpp:

 

#include <QtCore/QCoreApplication>

 

int main(int argc, char *argv[])

{

QCoreApplication a(argc, argv);

 

return a.exec();

}

 

If you don't intend to use any Qt stuff delete everything and create a new main. Sure the file is called main.cpp but it will compile c code. You can edit the .pro file and add your own sourcefiles with the .c extensions.

Link to comment
Share on other sites

If you choose File->New and under projects choose "Qt4 Console Application", click Next and then choose a project path and name.

 

Thank you, I did as you suggested. I got the following error message:

Running build steps for project HelloQt...
Creating gdb macros library...
No valid Qt version set. Set one in Tools/Options 
Error while building project HelloQt
When executing build step 'QMake'
Canceled build.

 

Under Tools -> Options -> Qt4, I see that the path of the auto-detected Qt version is "<not found>". I have some Qt packages installed on my machine, but I don't know which one I need or where it is located.

 

Anyway, according to Helio Castro's blog, Mandriva is packaging Qt creator, so I guess it will be available in 2009.1 with all the dependencies resolved. Maybe it's even already somewhere in the repositories, but I couldn't find the rpm file itself. So I might just wait another couple of weeks and hope for the best.

Link to comment
Share on other sites

Although I have not used the Qt ide. The ones that I have used the compiler has to be able to find the headers for your code. This is done by supplying options as to 'include' directories. As you discovered your code could not find the *.h files needed to include.

Depending how the particular ide handles this you will need to read up about unless ppcrulez can point you in the right direction. It would be fair to say I feel you are on a steep learning curve here just to do what may seem like a simple task.

If as I understand things you merely want to produce a simple application you may be as well not using an ide and do your compiling and linking using the command shell. Debugging is not too difficult this way unless you have many hundred lines of code, but even then you can still debug a 'c' program this way. Only when you get to using GUIs and complicated code blocks does a proper ide come into play because you can use breakpoints and watch variables and things which is not possible from the command line.

This doesn't mean to say don't use an ide if you prefer, it's just how I see things. :)

Link to comment
Share on other sites

Although I have not used the Qt ide. The ones that I have used the compiler has to be able to find the headers for your code. This is done by supplying options as to 'include' directories. As you discovered your code could not find the *.h files needed to include.

 

From what I read I understand it's not about header files, but about using qmake instead of cmake. That's what Helio was working on and should be solved in 2009.1, but maybe I understood wrongly.

 

It would be fair to say I feel you are on a steep learning curve here just to do what may seem like a simple task.

 

No doubt about it! Actually most of the program is ready, I just need to do some minor fixes I can easily do with CodeBlocks or from text editor. It's just that I really enjoy playing with these things. I also like to be able to use and control various tools. So it's more for the sake of learning than the sake of being able to finish the project.

Link to comment
Share on other sites

It's just that I really enjoy playing with these things. I also like to be able to use and control various tools. So it's more for the sake of learning than the sake of being able to finish the project.

Welcome to my wold I spend (waste as my wife says :D ) many hours learning these things. Good luck.

Link to comment
Share on other sites

Thank you, I did as you suggested. I got the following error message:

Running build steps for project HelloQt...
Creating gdb macros library...
No valid Qt version set. Set one in Tools/Options 
Error while building project HelloQt
When executing build step 'QMake'
Canceled build.

 

Under Tools -> Options -> Qt4, I see that the path of the auto-detected Qt version is "<not found>". I have some Qt packages installed on my machine, but I don't know which one I need or where it is located.

 

Actually you're just missing the qt developer files, since qt creator is using QMake. They are available in Mandriva repos, install libqt4-devel either from Mandriva Control Center or with

 

urpmi libqt4-devel

 

If you use Mandriva 2009.0 and have an updated system you will get the latest qt v4.5 (not that it really matters).

 

I 'm not sure if starting Qt Creator after that will autodetect the paths, but if it doesn't. Press the + sign in the Tools -> Options -> Qt4 menu and add /usr/lib/qt4 as path (or browse to that folder). Now you should be able to compile :D

 

(Also you must enter a Version name for the path. Just enter qt4 if it's not added automatically)

Edited by ppcrulez
Link to comment
Share on other sites

Actually you're just missing the qt developer files, since qt creator is using QMake. They are available in Mandriva repos, install libqt4-devel

 

Darn, it works! You're a wizard! Didn't even have to set manually the path. Thanks.

 

And for all the others that recommended me on other IDE's - though I'll stick to Qt creator for at least a few days until I find my arms and legs, I appreciate your help and reserve the right to try your recommended environments some other day. So watch out. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...