Subject: problems caused by memory.h
From: [email-masked] (Ulrich Lauther)

6 May 1997 19:11:26 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Original-To: [email-masked]
X-Mailer: ELM [version 2.4ME+ PL28s (25)]
Original-Sender: [email-masked]

The following message possibly didn't make it to the list,
so I try again:

#include <memory.h>
main () {
}

when I try to compile the above program, stored as test.cc, I get
a heap of error messages.
Part of the problem is that memory.h includes string.h which gets
confused with String.h. This goes away if I use an absolute pathname
in memory.h for the inclusion of string.h.
The part I do not understand are error messages due to multiple
definitions
in String.h, which however are legal C++ overloadings.
Any hints how to explain and fix the problem?

	-ulrich

 gcc -v -c test.cc
Reading specs from 
C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/s
pecs
gcc version cygnus-2.7.2-961023
   
C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/c
pp.  
exe -lang-c++ -v -iprefix 
C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/

 -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=7
-Di386 
 -D_WIN32 -DPOSIX -D__CYGWIN32__ -DWINNT -D_X86_=1 -D__STDC__=1 
 -D__stdcall=__attribute__((__stdcall__)) 
 -D__cdecl=__attribute__((__cdecl__)) -D__i386__ -D_WIN32 -D__POSIX__ 
 -D__CYGWIN32__ -D__WINNT__ -D_X86_=1 -D__STDC__=1 
 -D__stdcall=__attribute__((__stdcall__)) 
 -D__cdecl=__attribute__((__cdecl__)) -D__i386 -D__POSIX -D__WINNT 
 -Asystem(winnt) -Acpu(i386) -Amachine(i386) -Di386 -Asystem(unix) 
 -Acpu(i386) -Amachine(i386) -D__i386__ -Asystem(unix) -Acpu(i386) 
 -Amachine(i386) test.cc C:\WINDOWS\TEMP/cc001333.ii
GNU CPP version cygnus-2.7.2-961023 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
   
C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/.
../.  
../../../../include/g++
   
C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/.
../.  
../../../../include
   
C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/.
../.  
../../../i386-cygwin32/include
   
C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/i
ncl  
ude
End of search list.
   
C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/c
c1p  
lus.exe C:\WINDOWS\TEMP/cc001333.ii -quiet -dumpbase test.cc -version -o

C:\WINDOWS\TEMP/cc001333.s
GNU C++ version cygnus-2.7.2-961023 (i386-cygwin32) compiled by GNU C
version 
cygnus-2.7.2-961023.
In file included from 
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../i386-cygwin32/include/memory.h:4,
                 from test.cc:1:
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:45: declaration of C function
`struct 
StrRep * Scat(struct StrRep *, const char *, int, const char *, int,
const 
char *, int)' conflicts with
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:44: previous declaration `struct
StrRep 
* Scat(struct StrRep *, const char *, int, const char *, int)' here
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:160: declaration of C function
`void 
cat(const class String &, const class SubString &, class String &)'
conflicts 
with
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:159: previous declaration `void 
cat(const class String &, const class String &, class String &)' here
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:160: warning: `cat(const String &,
const 
SubString &, String &)' is already a friend of class `String'
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:160: warning: previous friend 
declaration of `cat(const String &, const SubString &, String &)'
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:161: declaration of C function
`void 
cat(const class String &, const char *, class String &)' conflicts with
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:160: previous declaration `void 
cat(const class String &, const class SubString &, class String &)' here
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:161: warning: `cat(const String &,
const 
char *, String &)' is already a friend of class `String'
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:161: warning: previous friend 
declaration of `cat(const String &, const char *, String &)'
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:162: declaration of C function
`void 
cat(const class String &, char, class String &)' conflicts with
C:\\cygnus\\H-i386-cygwin32\\lib\\gcc-lib\\i386-cygwin32/cygnus-2.7.2-961
023  
/../../../../../include/g++/string.h:161: previous declaration `void 
cat(const class String &, const char *, class String &)' here

[further error messages deleted]
-- 
	-lauther

----------------------------------------------------------------------------
Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 42284
Siemens ZT AN 1         Internet: [email-masked]
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".