compiling and gcc2.7.0

From: Jonathan Berry <berryj_at_dimacs.rutgers.edu>
Date: Wed, 22 May 1996 12:06:53 -0400

Just a note on portability -

stk.h includes string.h and memory.h. When STk is compiled using C++,
the entire stk.h file is enclosed in an extern "C" environment. For
some reason which I haven't taken the time to determine, including
string.h and memory.h in such an environment bombs the compilation
with g++2.7.0. I have have no problem with 2.7.2 or 2.6.3.
Moving the includes of string.h and memory.h outside of the extern "C"
solves the problem in 2.7.0.
        Jon

This was the error:
/usr/local/gnu/lib/g++-include/std/cstring.h: In function `char * strchr(char *, int)':
In file included from /usr/local/gnu/lib/g++-include/cstring:5,
                 from /usr/local/gnu/lib/g++-include/string.h:5,
                 from /usr/local/packages/STk/build/Src/stk.h:39,
                 from STkTemplateFiles.cc:2:
/usr/local/gnu/lib/g++-include/std/cstring.h:34: declaration of C function `char * strchr(char *, int)' conflicts with
/usr/local/gnu/lib/g++-include/std/cstring.h:31: previous declaration `char * strchr(const char *, int)' here
....
...
...
Received on Wed May 22 1996 - 18:05:37 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST