Solved

gcc error.. no cpp?

Posted on 1998-11-07
4
556 Views
Last Modified: 2010-04-20
i get this when i try to run gcc:
gcc: installation problem, cannot exec `cpp': No such file or directory  
it was working fine before.. what do i need to do?
thanks..
0
Comment
Question by:Vickio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Accepted Solution

by:
jji earned 70 total points
ID: 1638450
from "man gcc":
.
LIBDIR/cpp         preprocessor
.
LIBDIR is usually /usr/local/lib/machine/version.


So it seems like you have somehow lost your copy of cpp. Try
`locate cpp|grep lib`, if you find it somewhere put the path
to your /etc/ld.so.conf and run `ldconfig -v`.
(Or you could re-install gcc.....)
0
 

Author Comment

by:Vickio
ID: 1638451
it didnt find cpp, so i reinstalled gcc (or tried to at least) and now it will compile a c file  no problem but when i tried a simple c++ file (that just printed some text) i got this:

In file included from /usr/include/g++/iostream.h:31,
                 from test.cc:1:
/usr/include/g++/streambuf.h:403: warning: invalid type `void *' for default argument to `ios *'
In file included from test.cc:1:
/usr/include/g++/iostream.h:50: warning: invalid type `void *' for default argument to `ostream *'
/usr/include/g++/iostream.h:123: warning: invalid type `void *' for default argument to `ostream *'
/usr/include/g++/iostream.h:230: warning: invalid type `void *' for default argument to `ostream *'
/tmp/cca011651.o: In function `main':
/tmp/cca011651.o(.text+0x9): undefined reference to `cout'
/tmp/cca011651.o(.text+0xe): undefined reference to `ostream::operator<<(char const *)'  

so now what?
0
 

Expert Comment

by:jji
ID: 1638452
It seems like you don´t have libraries around or you didn´t
include them properly....
Did you compile it with g++? (g++ test.cc) If not it sure
will do something like that.
Try with g++ and if got no luck throw the code here.
0
 

Author Comment

by:Vickio
ID: 1638453
ok, got it working now.
thanks.
0

Featured Post

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question