Compiling error cpp..

Post questions regarding programming in C/C++ in Linux/Unix.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Compiling error cpp..

Postby Code_Nerd » Mon Dec 19, 2005 4:51 pm

I have just fired up my Linux in the hiolidays to try and get a bit more familiar with it..

Anyway I am trying to compile a simple "Hello World" prog and get this error?
Code: Select all
cpp: installation problem, cannot exec 'cc1plus': No such file or directory


Does anyone know what this is and how to fix it?

BTW I am using FC4..
"I'm probably the best gamer I know!"
User avatar
Code_Nerd
 
Posts: 243
Joined: Mon Dec 13, 2004 5:11 pm
Location: Newcastle.. Australia

Postby Alvaro » Tue Dec 20, 2005 6:37 am

How exactly are you trying to compile your program?
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby jeng » Tue Dec 20, 2005 1:43 pm

Sounds like you don't have g++ installed.
I don't need big brains to have a good time.
User avatar
jeng
 
Posts: 105
Joined: Thu Sep 08, 2005 11:17 am
Location: The Ghost Planet

Postby Code_Nerd » Tue Dec 20, 2005 3:26 pm

I defiantely have it installed, I cannot confirm my PATH is correct however??

I am trying to compile like so:
Code: Select all
cpp -o test test.cpp


Is this correct?
"I'm probably the best gamer I know!"
User avatar
Code_Nerd
 
Posts: 243
Joined: Mon Dec 13, 2004 5:11 pm
Location: Newcastle.. Australia

Postby Safari » Tue Dec 20, 2005 3:33 pm

try this

g++ test.cpp -o test
你 好!
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Code_Nerd » Tue Dec 20, 2005 4:18 pm

Got command not found error?

Code: Select all
bash: g++: command not found


I know it is installed, but whether I have it linked correct or whatever is another story? :roll:

If I do
Code: Select all
cpp -v


I get the following?

Code: Select all
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --host=i386-redhat-linux
Thread model: posix
gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)
/usr/libexec/gcc/i386-redhat-linux/4.0.1/cc1 -E -quiet -v -
ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.0.1/../../../../i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/i386-redhat-linux/4.0.1/include
/usr/include
End of search list.
"I'm probably the best gamer I know!"
User avatar
Code_Nerd
 
Posts: 243
Joined: Mon Dec 13, 2004 5:11 pm
Location: Newcastle.. Australia

Postby Code_Nerd » Wed Dec 21, 2005 5:21 pm

bump..

Any more ideas?
"I'm probably the best gamer I know!"
User avatar
Code_Nerd
 
Posts: 243
Joined: Mon Dec 13, 2004 5:11 pm
Location: Newcastle.. Australia

Postby Vash5556 » Wed Dec 21, 2005 11:33 pm

looks like g++ isn't installed, if you are sure it is try reinstalling it. after that this should work
Code: Select all
g++ test.cpp -o test


edit: after some digging also, cpp is the C Preprocessor, this is probably not what you want for compiling your program. :)
User avatar
Vash5556
 
Posts: 46
Joined: Sun Jun 13, 2004 5:14 pm


Return to Unix/Linux

Who is online

Users browsing this forum: No registered users and 0 guests