Hello...I wanted to install kdevelop on my fedora 8 PC ....so I did "yum install kdevelop".It installed fine. When I tried compiling a program it complained of missing g++ and gcc so I did "yum install gcc-c++" and made the PATH variable point to gcc34. Now when I try to compile the following program

Code:

#include <iostream>
using namespace std;
int main()
 {
   cout << "A";
   return 0;
 }

I get the following...

cd '/home/sugantha/Hello/debug/src' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" LC_MESSAGES="C" LC_CTYPE="C" gmake -k hello.lo
compiling hello.cpp (g++)
compiling hello.cpp (g++)
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/c++config.h:43: error: expected constructor, destructor, or type conversion before 'namespace'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/c++config.h:47: error: '__gnu_debug_def' is not a namespace-name
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/c++config.h:47: error: expected namespace-name before ';' token
gmake: *** [hello.lo] Error 1
*** Exited with status: 2 ***

Can someone suggest what I should do to get over this...Could'nt get any good answers googling.Am I supposed to configure something before trying to compile programs...Thanks in advance.

sorry...typo in the subject line :P ....It's KDevelop

Did you change anything in the c++config.h file?

Could you post lines 40-50 from c++config.h?

Thanks for your reply....I did'nt change the contents of c++config.h.Here are the contents of it...

// Debug mode support. Debug mode basic_string is not allowed to be
// associated with std, because of locale and exception link
// dependence.
namespace __gnu_debug_def { }

namespace __gnu_debug
{
using namespace __gnu_debug_def;
}

#ifdef _GLIBCXX_DEBUG

That looks fine to me.
Could you enter this in the directory where your .cpp file is: g++ -g -Wall hello.cpp -o hello and see if g++ will compile your code?

Hello...That compiles well and I can see the output...Thanks...

I've never worked with kDevelop before, so I can't tell you how or where to change it, but something is wrong with the configuration of kDevelop. Perhaps someone more familiar with Linux/kDevelop can help you with this problem. Sorry I can't be of better help..

Thanks for your help so far...Will do for now with g++ command in the terminal and try asking in the linux forum...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.