Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
When i try to compile a simple c++ program with the use of the iostream and string header files i get the following error: (I had to cut the errors ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Posts
    9

    g++ problem during compile


    When i try to compile a simple c++ program with the use of the iostream and string header files i get the following error: (I had to cut the errors due to character limitations on this forum. I am using Suse 9.1 Professional.)

    Code:
    rscheckler@linux:~/Desktop> g++ Test.cpp
    In file included from /usr/include/g++/i586-suse-linux/bits/c++config.h:35,
                     from /usr/include/g++/iostream:44,
                     from Test.cpp:1:
    /usr/include/g++/i586-suse-linux/bits/os_defines.h:39:22: features.h: No such fi le or directory
    /usr/include/g++/i586-suse-linux/bits/os_defines.h:46:23: gnu/types.h: No such f ile or directory
    In file included from /usr/include/g++/i586-suse-linux/bits/c++config.h:35,
                     from /usr/include/g++/iostream:44,
                     from Test.cpp:1:
    /usr/include/g++/i586-suse-linux/bits/os_defines.h:47: error: syntax error
       before `;' token
    In file included from /usr/include/g++/i586-suse-linux/bits/c++locale.h:41,
                     from /usr/include/g++/iosfwd:46,
                     from /usr/include/g++/ios:44,
                     from /usr/include/g++/ostream:45,
                     from /usr/include/g++/iostream:45,
                     from Test.cpp:1:
    /usr/include/g++/clocale:49:20: locale.h: No such file or directory
    In file included from /usr/include/g++/i586-suse-linux/bits/c++locale.h:41,
                     from /usr/include/g++/iosfwd:46,
                     from /usr/include/g++/ios:44,
                     from /usr/include/g++/ostream:45,
                     from /usr/include/g++/iostream:45,
                     from Test.cpp:1:
    /usr/include/g++/clocale:57: error: `lconv' not declared
    /usr/include/g++/clocale:58: error: `setlocale' not declared
    /usr/include/g++/clocale:59: error: `localeconv' not declared
    In file included from /usr/include/g++/iosfwd:46,
                     from /usr/include/g++/ios:44,
                     from /usr/include/g++/ostream:45,
                     from /usr/include/g++/iostream:45,
                     from Test.cpp:1:
    /usr/include/g++/i586-suse-linux/bits/c++locale.h:42:47: langinfo.h: No such fil e or directory
    /usr/include/g++/i586-suse-linux/bits/c++locale.h:43:68: iconv.h: No such file o r directory
    /usr/include/g++/i586-suse-linux/bits/c++locale.h:44:48: libintl.h: No such file  or directory
    In file included from /usr/include/g++/iosfwd:46,
                     from /usr/include/g++/ios:44,
                     from /usr/include/g++/ostream:45,
                     from /usr/include/g++/iostream:45,
                     from Test.cpp:1:
    /usr/include/g++/i586-suse-linux/bits/c++locale.h:59: error: syntax error
       before `;' token
    /usr/include/g++/i586-suse-linux/bits/c++locale.h:73: error: syntax error
       before `&' token
    In file included from /usr/include/g++/iosfwd:47,
                     from /usr/include/g++/ios:44,
                     from /usr/include/g++/ostream:45,
                     from /usr/include/g++/iostream:45,
                     from Test.cpp:1:
    /usr/include/g++/cctype:49:19: ctype.h: No such file or directory
    In file included from /usr/include/g++/iosfwd:47,
                     from /usr/include/g++/ios:44,
                     from /usr/include/g++/ostream:45,
                     from /usr/include/g++/iostream:45,
                     from Test.cpp:1:
    /usr/include/g++/cctype:68: error: `isalnum' not declared
    /usr/include/g++/cctype:69: error: `isalpha' not declared
    /usr/include/g++/cctype:70: error: `iscntrl' not declared
    /usr/include/g++/cctype:71: error: `isdigit' not declared
    /usr/include/g++/cctype:72: error: `isgraph' not declared
    /usr/include/g++/cctype:73: error: `islower' not declared
    /usr/include/g++/cctype:74: error: `isprint' not declared
    /usr/include/g++/cctype:75: error: `ispunct' not declared
    /usr/include/g++/cctype:76: error: `isspace' not declared
    /usr/include/g++/cctype:77: error: `isupper' not declared
    /usr/include/g++/cctype:78: error: `isxdigit' not declared
    /usr/include/g++/cctype:79: error: `tolower' not declared
    /usr/include/g++/cctype:80: error: `toupper' not declared
    In file included from /usr/include/g++/i586-suse-linux/bits/c++io.h:35,
                     from /usr/include/g++/bits/fpos.h:44,
                     from /usr/include/g++/iosfwd:49,
                     from /usr/include/g++/ios:44,
                     from /usr/include/g++/ostream:45,
                     from /usr/include/g++/iostream:45,
                     from Test.cpp:1:
    /usr/include/g++/cstdio:52:19: stdio.h: No such file or directory
    In file included from /usr/include/g++/i586-suse-linux/bits/c++io.h:35,
                     from /usr/include/g++/bits/fpos.h:44,
                     from /usr/include/g++/iosfwd:49,
                     from /usr/include/g++/ios:44,
                     from /usr/include/g++/ostream:45,
                     from /usr/include/g++/iostream:45,
                     from Test.cpp:1:
    /usr/include/g++/cstdio:99: error: `FILE' not declared
    /usr/include/g++/cstdio:100: error: `fpos_t' not declared
    /usr/include/g++/cstdio:102: error: `clearerr' not declared
    /usr/include/g++/cstdio:103: error: `fclose' not declared
    /usr/include/g++/cstdio:104: error: `feof' not declared
    /usr/include/g++/cstdio:105: error: `ferror' not declared
    /usr/include/g++/cstdio:106: error: `fflush' not declared
    /usr/include/g++/cstdio:107: error: `fgetc' not declared
    /usr/include/g++/cstdio:108: error: `fgetpos' not declared
    /usr/include/g++/cstdio:109: error: `fgets' not declared
    /usr/include/g++/cstdio:110: error: `fopen' not declared
    /usr/include/g++/cstdio:111: error: `fprintf' not declared
    /usr/include/g++/cstdio:112: error: `fputc' not declared
    /usr/include/g++/cstdio:113: error: `fputs' not declared
    /usr/include/g++/cstdio:114: error: `fread' not declared
    /usr/include/g++/cstdio:115: error: `freopen' not declared
    /usr/include/g++/cstdio:116: error: `fscanf' not declared
    /usr/include/g++/cstdio:117: error: `fseek' not declared
    /usr/include/g++/cstdio:118: error: `fsetpos' not declared
    /usr/include/g++/cstdio:119: error: `ftell' not declared
    /usr/include/g++/cstdio:120: error: `fwrite' not declared
    /usr/include/g++/cstdio:121: error: `getc' not declared
    /usr/include/g++/cstdio:122: error: `getchar' not declared
    /usr/include/g++/cstdio:123: error: `gets' not declared
    /usr/include/g++/cstdio:124: error: `perror' not declared
    /usr/include/g++/cstdio:125: error: `printf' not declared
    /usr/include/g++/cstdio:126: error: `putc' not declared
    /usr/include/g++/cstdio:127: error: `putchar' not declared
    /usr/include/g++/cstdio:128: error: `puts' not declared
    /usr/include/g++/cstdio:129: error: `remove' not declared
    /usr/include/g++/cstdio:130: error: `rename' not declared
    /usr/include/g++/cstdio:131: error: `rewind' not declared
    /usr/include/g++/cstdio:132: error: `scanf' not declared
    /usr/include/g++/cstdio:133: error: `setbuf' not declared
    /usr/include/g++/cstdio:134: error: `setvbuf' not declared
    /usr/include/g++/cstdio:135: error: `sprintf' not declared
    /usr/include/g++/cstdio:136: error: `sscanf' not declared
    /usr/include/g++/cstdio:137: error: `tmpfile' not declared
    /usr/include/g++/cstdio:138: error: `tmpnam' not declared
    /usr/include/g++/cstdio:139: error: `ungetc' not declared
    /usr/include/g++/cstdio:140: error: `vfprintf' not declared
    /usr/include/g++/cstdio:141: error: `vprintf' not declared
    /usr/include/g++/cstdio:142: error: `vsprintf' not declared
    /usr/include/g++/cstdio:167: error: `snprintf' not declared
    /usr/include/g++/cstdio:168: error: `vfscanf' not declared
    /usr/include/g++/cstdio:169: error: `vscanf' not declared
    /usr/include/g++/cstdio:170: error: `vsnprintf' not declared
    /usr/include/g++/cstdio:171: error: `vsscanf' not declared
    /usr/include/g++/cstdio:177: error: `snprintf' not declared
    /usr/include/g++/cstdio:178: error: `vfscanf' not declared
    /usr/include/g++/cstdio:179: error: `vscanf' not declared
    /usr/include/g++/cstdio:180: error: `vsnprintf' not declared
    /usr/include/g++/cstdio:181: error: `vsscanf' not declared
    Any Ideas as to whats wrong????
    Last edited by techieMoe; 10-19-2006 at 08:38 PM. Reason: Added "code" tags.

  2. #2
    Linux Newbie DeoXMAN's Avatar
    Join Date
    Jul 2005
    Location
    Azerbaijan, Germany
    Posts
    154
    can you post program itself?
    Karabakh - I will be back

  3. #3
    Just Joined! Tomato's Avatar
    Join Date
    Aug 2006
    Location
    HKSAR, China
    Posts
    63
    Is the compiler installed well or can it compile other program before?
    It seems it cannot find the built in files.
    Of course, no result can be concluded before reading your program now.

  4. #4
    Just Joined!
    Join Date
    Aug 2006
    Posts
    9
    #include<iostream>
    #include<string>
    using namespace std;
    int main()
    {
    string name;
    cout << "Type in your name." << endl;
    cin >> name;
    cout << "Hello " << name << "!" << endl;
    return 0;
    }

    This program is first and only program I attempted to compile on this computer.

  5. #5
    Linux Newbie DeoXMAN's Avatar
    Join Date
    Jul 2005
    Location
    Azerbaijan, Germany
    Posts
    154
    program worked right for me..
    check if you have also gcc installed, maybe it is because of this ( see, at the end of problems it comlains because of not being able to find c file)
    Karabakh - I will be back

  6. #6
    Just Joined!
    Join Date
    Aug 2006
    Posts
    9
    I can access the gpp directory and even access the .h files and all are there. That is the thing I dont understand. All the files are there. Because i thought maybe for some reason iostream.h wasnt included in the directory. But i found them all.

  7. #7
    Linux Newbie DeoXMAN's Avatar
    Join Date
    Jul 2005
    Location
    Azerbaijan, Germany
    Posts
    154
    then i guess that something should be wrong with paths...
    Karabakh - I will be back

  8. #8
    Just Joined!
    Join Date
    Aug 2006
    Posts
    9
    Yeah, but what...and how can i fix it...haha

  9. #9
    Linux Enthusiast KenJackson's Avatar
    Join Date
    Jun 2006
    Location
    Maryland, USA
    Posts
    510
    ... features.h: No such file or directory
    My Mandriva system has /usr/include/features.h, does yours?

    Code:
    # rpm -qf /usr/include/features.h
    glibc-devel-2.3.5-5mdk
    Do you have glibc-devel installed? (Run rpm -q glibc-devel to see.)
    If yes, then try this to see if it's intact and reinstall it if not.
    If this command runs and does not produce any output, then rpm thinks everything is good.
    Code:
    rpm -V glibc-devel

  10. #10
    Just Joined!
    Join Date
    Aug 2006
    Posts
    9
    I will have to check it out once I get back to school on Sunday.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •