Menu

RE: netmap 0.1.2b compile problems

Help
2001-12-27
2003-03-08
  • Wouter Godefroy

    Wouter Godefroy - 2001-12-27

    Hello,

    Other users have encountered this problem as well. In every .c and .h file you'll have to add a '.h' to every include that doens't have one. So for example, if one of the files contains:
      
        #include <strstream>
        #include <iostream>
        #include <string>

    you'll have to change it in:

        #include <strstream.h>
        #include <iostream.h>
        #include <string.h>

    which should fix your problem. I think I'll make this the default in a next release.

    Good luck,
    Wouter Godefroy

    xercist wrote:

    >I'm using gcc3, so that might be the problem...
    >
    >make -C belgolib
    >make[1]: Entering directory `/data/home/xercist/src/netmap-0.1.2b/belgolib'
    >g++ -O -Wall   -c -o files.o files.c
    >In file included from files.c:5:
    >files.h:15: parse error before `{' token
    >files.h:18: parse error before `const'
    >files.h:19: parse error before `&' token
    >files.h:25: parse error before `{' token
    >files.h:28: parse error before `const'
    >files.h:29: parse error before `&' token
    >files.h:35: base class `Outfile' has incomplete type
    >files.h:38: parse error before `&' token
    >files.h:40: parse error before `&' token
    >files.c:17: invalid use of undefined type `class Infile'
    >files.h:15: forward declaration of `class Infile'
    >files.c: In constructor `Infile::Infile()':
    >files.c:17: class `Infile' does not have any field named `ifstream'
    >files.c: At global scope:
    >files.c:19: parse error before `&' token
    >files.c:20: invalid use of undefined type `class Infile'
    >files.h:15: forward declaration of `class Infile'
    >files.c: In constructor `Infile::Infile(...)':
    >files.c:20: `file_name' undeclared (first use this function)
    >files.c:20: (Each undeclared identifier is reported only once for each function
    >   it appears in.)
    >files.c:20: `mode' undeclared (first use this function)
    >files.c:20: class `Infile' does not have any field named `ifstream'
    >files.c:24: no match for `Dbgfile& << const char[21]' operator
    >files.c:26: `check_open' undeclared (first use this function)
    >files.c:28: no match for `Dbgfile& << const char[9]' operator
    >files.c:28: `endl' undeclared (first use this function)
    >files.c:31: `fatal' undeclared (first use this function)
    >files.c:32: `cout' undeclared (first use this function)
    >files.c:36: no match for `Dbgfile& << const char[9]' operator
    >files.c: At global scope:
    >files.c:41: parse error before `&' token
    >files.c:42: invalid use of undefined type `class Infile'
    >files.h:15: forward declaration of `class Infile'
    >files.c: In member function `int Infile::Open(...)':
    >files.c:45: no match for `Dbgfile& << const char[21]' operator
    >files.c:47: no match for `! Infile&' operator
    >files.c:47: candidates are: operator!(bool) <builtin>
    >files.c:49: `close' undeclared (first use this function)
    >files.c:51: `open' undeclared (first use this function)
    >files.c:55: no match for `Dbgfile& << const char[9]' operator
    >files.c:60: no match for `Dbgfile& << const char[35]' operator
    >files.c:66: no match for `Dbgfile& << const char[10]' operator
    >files.c: At global scope:
    >files.c:75: invalid use of undefined type `class Infile'
    >files.h:15: forward declaration of `class Infile'
    >files.c: In member function `int Infile::check_open() const':
    >files.c:76: could not convert `*this' to `bool'
    >files.c: At global scope:
    >files.c:87: invalid use of undefined type `class Outfile'
    >files.h:25: forward declaration of `class Outfile'
    >files.c: In constructor `Outfile::Outfile()':
    >files.c:87: class `Outfile' does not have any field named `ofstream'
    >files.c: At global scope:
    >files.c:89: parse error before `&' token
    >files.c:89: invalid use of undefined type `class Outfile'
    >files.h:25: forward declaration of `class Outfile'
    >files.c: In constructor `Outfile::Outfile(...)':
    >files.c:90: class `Outfile' does not have any field named `ofstream'
    >files.c:93: no match for `Dbgfile& << const char[22]' operator
    >files.c:97: no match for `Dbgfile& << const char[9]' operator
    >files.c:102: no match for `Dbgfile& << const char[9]' operator
    >files.c:106: no match for `Dbgfile& << const char[10]' operator
    >files.c: At global scope:
    >files.c:109: parse error before `&' token
    >files.c:110: invalid use of undefined type `class Outfile'
    >files.h:25: forward declaration of `class Outfile'
    >files.c: In member function `int Outfile::Open(...)':
    >files.c:112: no match for `Dbgfile& << const char[22]' operator
    >files.c:114: no match for `! Outfile&' operator
    >files.c:114: candidates are: operator!(bool) <builtin>
    >files.c:122: no match for `Dbgfile& << const char[9]' operator
    >files.c:127: no match for `Dbgfile& << const char[36]' operator
    >files.c:133: no match for `Dbgfile& << const char[10]' operator
    >files.c: At global scope:
    >files.c:141: invalid use of undefined type `class Outfile'
    >files.h:25: forward declaration of `class Outfile'
    >files.c: In member function `int Outfile::check_open() const':
    >files.c:142: could not convert `*this' to `bool'
    >files.c: At global scope:
    >files.c:158: parse error before `&' token
    >files.c:162: syntax error before `<<' token
    >files.c:163: ISO C++ forbids declaration of `exit' with no type
    >files.c:163: `int exit' redeclared as different kind of symbol
    >/usr/include/stdlib.h:577: previous declaration of `void exit(int)'
    >files.c:164: parse error before `}' token
    >make[1]: *** [files.o] Error 1
    >make[1]: Leaving directory `/data/home/xercist/src/netmap-0.1.2b/belgolib'
    >make: *** [all] Error 2
    >

     
    • Anonymous

      Anonymous - 2003-03-06

      I fixed the include statements as described but I'm still having problems.  I'm running Solaris 8 with gcc 3.2.2 installed.  Running make produces the following:

      make -C belgolib
      make[1]: Entering directory `/opt/apps1/download/netmap-0.1.2b/belgolib'
      g++ -O -Wall    -c -o files.o files.c
      In file included from /usr/local/include/c++/3.2.2/backward/fstream.h:31,
                       from files.h:1,
                       from files.c:5:
      /usr/local/include/c++/3.2.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
      In file included from files.c:5:
      files.h:18: parse error before `&' token
      files.h:19: parse error before `&' token
      files.h:28: parse error before `&' token
      files.h:29: parse error before `&' token
      files.h:38: parse error before `&' token
      files.h:40: parse error before `&' token
      files.c:19: parse error before `&' token
      files.c:30: `file_name' was not declared in this scope
      files.c:30: ISO C++ forbids declaration of `perror' with no type
      files.c:30: `int perror' redeclared as different kind of symbol
      /usr/include/iso/stdio_iso.h:219: previous declaration of `void perror(const
         char*)'
      files.c:31: parse error before `if'
      files.c:33: ISO C++ forbids declaration of `exit' with no type
      files.c:33: `int exit' redeclared as different kind of symbol
      /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.2/include/iso/stdlib_iso.h:113: previous
         declaration of `void exit(int)'
      files.c:34: parse error before `}' token
      files.c:41: parse error before `&' token
      files.c: In member function `int Infile::Open(...)':
      files.c:45: `file_name' undeclared (first use this function)
      files.c:45: (Each undeclared identifier is reported only once for each function
         it appears in.)
      files.c:51: `mode' undeclared (first use this function)
      files.c:55: `endl' undeclared (first use this function)
      files.c:57: `perror' cannot be used as a function
      files.c:59: `fatal' undeclared (first use this function)
      files.c:61: `exit' cannot be used as a function
      files.c: At global scope:
      files.c:87: cannot declare member function `Outfile::Outfile' within `Infile'
      files.c:87: syntax error before `:' token
      files.c:89: parse error before `&' token
      files.c:99: ISO C++ forbids declaration of `perror' with no type
      files.c:99: redefinition of `int perror'
      files.c:30: `int perror' previously defined here
      files.c:101: parse error before `if'
      files.c:103: ISO C++ forbids declaration of `exit' with no type
      files.c:103: redefinition of `int exit'
      files.c:33: `int exit' previously defined here
      files.c:104: parse error before `}' token
      files.c:109: parse error before `&' token
      files.c: In member function `int Outfile::Open(...)':
      files.c:124: `perror' cannot be used as a function
      files.c:128: `exit' cannot be used as a function
      files.c: At global scope:
      files.c:149: cannot declare member function `Dbgfile::Dbgfile' within `Outfile'
      files.c:149: syntax error before `{' token
      files.c:158: parse error before `&' token
      files.c:162: syntax error before `<<' token
      files.c:163: ISO C++ forbids declaration of `exit' with no type
      files.c:163: redefinition of `int exit'
      files.c:103: `int exit' previously defined here
      files.c:164: parse error before `}' token
      make[1]: *** [files.o] Error 1
      make[1]: Leaving directory `/opt/apps1/download/netmap-0.1.2b/belgolib'
      make: *** [all] Error 2

      Does anyone have any ideas on what I'm doing wrong?

       
    • Anonymous

      Anonymous - 2003-03-06

      I fixed the include statements as described but I'm still having problems.  I'm running Solaris 8 with gcc 3.2.2 installed.  Running make produces the following:

      make -C belgolib
      make[1]: Entering directory `/opt/apps1/download/netmap-0.1.2b/belgolib'
      g++ -O -Wall    -c -o files.o files.c
      In file included from /usr/local/include/c++/3.2.2/backward/fstream.h:31,
                       from files.h:1,
                       from files.c:5:
      /usr/local/include/c++/3.2.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
      In file included from files.c:5:
      files.h:18: parse error before `&' token
      files.h:19: parse error before `&' token
      files.h:28: parse error before `&' token
      files.h:29: parse error before `&' token
      files.h:38: parse error before `&' token
      files.h:40: parse error before `&' token
      files.c:19: parse error before `&' token
      files.c:30: `file_name' was not declared in this scope
      files.c:30: ISO C++ forbids declaration of `perror' with no type
      files.c:30: `int perror' redeclared as different kind of symbol
      /usr/include/iso/stdio_iso.h:219: previous declaration of `void perror(const
         char*)'
      files.c:31: parse error before `if'
      files.c:33: ISO C++ forbids declaration of `exit' with no type
      files.c:33: `int exit' redeclared as different kind of symbol
      /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.2/include/iso/stdlib_iso.h:113: previous
         declaration of `void exit(int)'
      files.c:34: parse error before `}' token
      files.c:41: parse error before `&' token
      files.c: In member function `int Infile::Open(...)':
      files.c:45: `file_name' undeclared (first use this function)
      files.c:45: (Each undeclared identifier is reported only once for each function
         it appears in.)
      files.c:51: `mode' undeclared (first use this function)
      files.c:55: `endl' undeclared (first use this function)
      files.c:57: `perror' cannot be used as a function
      files.c:59: `fatal' undeclared (first use this function)
      files.c:61: `exit' cannot be used as a function
      files.c: At global scope:
      files.c:87: cannot declare member function `Outfile::Outfile' within `Infile'
      files.c:87: syntax error before `:' token
      files.c:89: parse error before `&' token
      files.c:99: ISO C++ forbids declaration of `perror' with no type
      files.c:99: redefinition of `int perror'
      files.c:30: `int perror' previously defined here
      files.c:101: parse error before `if'
      files.c:103: ISO C++ forbids declaration of `exit' with no type
      files.c:103: redefinition of `int exit'
      files.c:33: `int exit' previously defined here
      files.c:104: parse error before `}' token
      files.c:109: parse error before `&' token
      files.c: In member function `int Outfile::Open(...)':
      files.c:124: `perror' cannot be used as a function
      files.c:128: `exit' cannot be used as a function
      files.c: At global scope:
      files.c:149: cannot declare member function `Dbgfile::Dbgfile' within `Outfile'
      files.c:149: syntax error before `{' token
      files.c:158: parse error before `&' token
      files.c:162: syntax error before `<<' token
      files.c:163: ISO C++ forbids declaration of `exit' with no type
      files.c:163: redefinition of `int exit'
      files.c:103: `int exit' previously defined here
      files.c:164: parse error before `}' token
      make[1]: *** [files.o] Error 1
      make[1]: Leaving directory `/opt/apps1/download/netmap-0.1.2b/belgolib'
      make: *** [all] Error 2

      Does anyone have any ideas on what I'm doing wrong?

       
    • Kerry

      Kerry - 2003-03-08

      I'm having exactly the same problem after fixing the includes.  I am running linux and using gcc3.0.4.  Perhaps the version is the problem. I'll keep messing around with it.  Anyone else have any suggestions?

       

Log in to post a comment.