c++compilation

Compiling with f2c (Fortran compiler)--errors due to macros?


I am rying to compile code on MacOSX that requires f2c (it's for Fortran). I am a bit out of my depth and would appreciate any help!

When I do "make", I get many errors. My guess is that these are related to f2c. There could be macros in f2c that are a problem for Mac. Has anyone out there run into this kind of thing? Is there a solution?

Here are examples of the errors:

In file included from /usr/include/c++/4.2.1/ios:47,
                 from /usr/include/c++/4.2.1/istream:44,
                 from /usr/include/c++/4.2.1/fstream:45,
/usr/include/c++/4.2.1/bits/localefwd.h:58:34: error: macro "isspace" passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:82:34: error: macro "isdigit" passed 2 arguments, but takes just 1
In file included from /usr/include/c++/4.2.1/bits/basic_ios.h:44,
                 from /usr/include/c++/4.2.1/ios:50,
                 from /usr/include/c++/4.2.1/istream:44,
                 from /usr/include/c++/4.2.1/fstream:45,
/usr/include/c++/4.2.1/bits/locale_facets.h:4611:44: error: macro "isspace" passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4647:44: error: macro "isdigit" passed 2 arguments, but takes just 1
In file included from /usr/include/c++/4.2.1/iosfwd:47,
                 from /usr/include/c++/4.2.1/bits/stl_algobase.h:70,
                 from /usr/include/c++/4.2.1/algorithm:65,
/usr/include/c++/4.2.1/cctype:70: error: ‘::isalnum’ has not been declared
/usr/include/c++/4.2.1/cctype:71: error: ‘::isalpha’ has not been declared
/usr/include/c++/4.2.1/cctype:72: error: ‘::iscntrl’ has not been declared
/usr/include/c++/4.2.1/cctype:73: error: ‘::isdigit’ has not been declared
/usr/include/c++/4.2.1/cctype:74: error: ‘::isgraph’ has not been declared
/usr/include/c++/4.2.1/cctype:75: error: ‘::islower’ has not been declared
/usr/include/c++/4.2.1/cctype:76: error: ‘::isprint’ has not been declared
/usr/include/c++/4.2.1/cctype:77: error: ‘::ispunct’ has not been declared
/usr/include/c++/4.2.1/cctype:78: error: ‘::isspace’ has not been declared
/usr/include/c++/4.2.1/cctype:79: error: ‘::isupper’ has not been declared
/usr/include/c++/4.2.1/cctype:80: error: ‘::isxdigit’ has not been declared
/usr/include/c++/4.2.1/cctype:81: error: ‘::tolower’ has not been declared
/usr/include/c++/4.2.1/cctype:82: error: ‘::toupper’ has not been declared
In file included from /usr/include/wchar.h:114,
                 from /usr/include/c++/4.2.1/cwchar:55,
                 from /usr/include/c++/4.2.1/bits/postypes.h:46,
                 from /usr/include/c++/4.2.1/iosfwd:49,
                 from /usr/include/c++/4.2.1/bits/stl_algobase.h:70,
                 from /usr/include/c++/4.2.1/algorithm:65,
/usr/include/_wctype.h: In function ‘int iswalnum(wint_t)’:
/usr/include/_wctype.h:74: error: ‘_CTYPE_A’ was not declared in this scope
/usr/include/_wctype.h:74: error: ‘_CTYPE_D’ was not declared in this scope
/usr/include/_wctype.h:74: error: ‘__istype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswalpha(wint_t)’:
/usr/include/_wctype.h:80: error: ‘_CTYPE_A’ was not declared in this scope
/usr/include/_wctype.h:80: error: ‘__istype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswcntrl(wint_t)’:
/usr/include/_wctype.h:86: error: ‘_CTYPE_C’ was not declared in this scope
/usr/include/_wctype.h:86: error: ‘__istype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswctype(wint_t, wctype_t)’:
/usr/include/_wctype.h:92: error: ‘__istype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswdigit(wint_t)’:
/usr/include/_wctype.h:98: error: ‘_CTYPE_D’ was not declared in this scope
/usr/include/_wctype.h:98: error: ‘__isctype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswgraph(wint_t)’:
/usr/include/_wctype.h:104: error: ‘_CTYPE_G’ was not declared in this scope
/usr/include/_wctype.h:104: error: ‘__istype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswlower(wint_t)’:
/usr/include/_wctype.h:110: error: ‘_CTYPE_L’ was not declared in this scope
/usr/include/_wctype.h:110: error: ‘__istype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswprint(wint_t)’:
/usr/include/_wctype.h:116: error: ‘_CTYPE_R’ was not declared in this scope
/usr/include/_wctype.h:116: error: ‘__istype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswpunct(wint_t)’:
/usr/include/_wctype.h:122: error: ‘_CTYPE_P’ was not declared in this scope
/usr/include/_wctype.h:122: error: ‘__istype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswspace(wint_t)’:
/usr/include/_wctype.h:128: error: ‘_CTYPE_S’ was not declared in this scope
/usr/include/_wctype.h:128: error: ‘__istype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswupper(wint_t)’:
/usr/include/_wctype.h:134: error: ‘_CTYPE_U’ was not declared in this scope
/usr/include/_wctype.h:134: error: ‘__istype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘int iswxdigit(wint_t)’:
/usr/include/_wctype.h:140: error: ‘_CTYPE_X’ was not declared in this scope
/usr/include/_wctype.h:140: error: ‘__isctype’ was not declared in this scope
/usr/include/_wctype.h: In function ‘wint_t towlower(wint_t)’:
/usr/include/_wctype.h:146: error: ‘__tolower’ was not declared in this scope
/usr/include/_wctype.h: In function ‘wint_t towupper(wint_t)’:
/usr/include/_wctype.h:152: error: ‘__toupper’ was not declared in this scope

Solution

  • It seems that f2cgenerates some macros which names are already defined by your C++.