ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hey not new to programming C++ but new to linux... I'm running mandrake 9.1 and I'm using the KDevelop software. When I make a new file (testing.cpp), enter something simple like:
Can anyone shed some light on what I need to do to get this program working or any program in general? And when I hit run and assuming everything works, will the program run in the terminal or..?
Check your makefile (whether it was hand-written or generated by KDevelop). If you look at the message gmake gives you, it says that it's trying to compile a source file called testingdoc.cpp, then it fails because it can't find the file.
I don't use KDevelop so I can't give any suggestions on how to clean it up. My guess would be that perhaps you started a project, told it the name of the source was testingdoc.cpp, and then later changed your mind, but forgot to tell KDevelop about it. Then again, KDevelop could also just be confused on its own... dunno.
As for how he program will run, yes, I would assume a new terminal will open to execute the code. You might want to add a 'cin >> dummy_char;' line so you can see the output. Again, same disclaimers about KDevelop...
EDIT: Err... I had the whole cin command bacwards originally... oops.
Last edited by Dark_Helmet; 07-11-2003 at 12:38 AM.
I agree with Dark_Helmet, though myself don't use Kdevelop either. Probabably you accidentally changed the "file name settings" somewhere. Since the system tries to find testingdoc.cpp while what you have is testing.cpp.
The easier approch: Delete the project and make a new one; put the source file in the project and then build. However, I THINK it is necessary to add "using namespace std;" under #include <iostream>, like this:
#include <iostream>
using namespace std;
....
Other wise you'll get the error like: cout: No resolved symbol.
Did anyone else notice that the line said x.h? Perhaps if the code he is trying to compile is called testing.cpp, there must be a testingdoc.cpp elsewhere that is trying to be compiled, and is failing because the X lib/include paths are not available.. that's my guess, anyway. (=
I just probably realised it had something to do with the random "failed" messages I got on startup.. and on closer inspection when I got o KDevelop Setupd and try to find KDE-Libraries-Doc, it says to please install it. Now how would one go about installing this?
KDE Doc is not installed by default if you did not choose to install it for the first time. But I am suspecting whether the problem is caused by this. Since it is Doc file...
Ok, let's take a look. I am wondering if you have indeed installation problem with Kdevelop. Please compile under shell mode.
$:g++ -o testing testing.cpp
and see whether you can compile it. If so, I suggest reinstall the Kdevelop.
Last words: please bare in mind you might have to add "using namespace std" right after the #include macro.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.