LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   trouble with g++ (https://www.linuxquestions.org/questions/programming-9/trouble-with-g-9163/)

kleric 11-24-2001 07:01 PM

trouble with g++
 
I'm just starting to learn c++ and wrote a simple hello world program but when I try to compile, it outputs this:

<command line>: warning: "cpu" re-asserted
<command line>: warning: "machine" re-asserted
first.cpp:3:22: iostream.h: No such file or directory

I have no idea what this means, nor can I find any useful documentation on it anywhere on the web.
Does anyone know what's going on here? I desperately need to get my c++ compiler working...

acid_kewpie 11-25-2001 11:39 AM

no idea what the first bit means, but on my md81 distro iostream.h isn't on the default include path, which is a bugger. try using a printf statement rather than a cout / cin thing (assuming you are) to compile, if that works, then it's just the include paths to worry about

kleric 11-28-2001 05:18 PM

<command line>: warning: "cpu" re-asserted ??
 
Can anyone make any sense of this and glean any clues as to why I can't compile any c++ programs?

#g++ first.cpp -v

Using builtin specs.
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
cpp -lang-c++ -v -undef -D_GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D_ELF__ -Dunix -Di386__ -Dlinux -D__ELF -D__unix__ -D__i386 -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ first.cpp /tmp/ccfIUnbz.ii
Reading specs from /usr/lib/gcc-lib/i386-pld-linux/3.0.1/specs
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-shared --enable-threads=posix --enable-haifa --enable-languages=c,c++,f77,gcov,java,objc --enable-long-long --enable-namespaces --enable-multilib --with-gnu-as --with-gnu-ld --with-system-zlib --with-slibdir=/lib --without-x i386-pld-linux
Thread model:posix
gcc version 3.0.1
/usr/lib/gcc-lib/i386-pld-linux/3.0.1/cpp0 -lang-c++ -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -v -D_NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ first.cpp -o /tmp/ccfIUnbz.ii
GNU CPP version 3.0.1 (cpplib) (i386 Linux/ELF)
ignoring nonexistent directory "/usr/include/g++-v3"
ignoring nonexistent directory "/usr/include/g++-v3/i386-pld-linux"
ignoring nonexistent directory "/usr/include/g++-v3/backward"
ignoring nonexistent directory "/usr/i386-pld-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/i386-pld-linux/3.0.1/include
/usr/include
End of search list.

<command line>: warning: "cpu" re-asserted
<command line>: warning: "machine" re-asserted
first.cpp:3:24: iostream.h: No such file or directory

gui10 11-30-2001 10:29 AM

i can't make sense of almost all of the error messages... in fact i only understand one ;)
perhaps the most crucial one (unless a gcc/g++ guru deigns to come down from his ivory tower and explain to you otherwise) is the last line of your post...

as acid kewpie guessed rightly, your iostream.h file is not present in your include directory on your installation...

so... it's time to either upgrade your rh6.0 to something more recent (since the later versions of the rh distro has more recent versions of gcc/g++) or go download latest gcc/g++ compiler and install it on your box... :)

or you could try doing this: :smash:

:) good luck!


All times are GMT -5. The time now is 11:11 PM.