This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems with c++ (gcc 2.95.3) on Sys V R4.0


Thanks this helped.

the following patch applied to /usr/include/fcntl.h solved the problem

--- fcntl.h Mon Jan  7 08:18:06 2002
+++ fcntl.h_new Mon Jan  7 08:17:44 2002
@@ -15,7 +15,13 @@
 #if defined(__STDC__)

 extern int fcntl(int, int, ...);
+#ifdef __cplusplus
+extern "C" {
 extern int open(const char *, int, ...);
+extern int open(const char *, int, ...);
 extern int creat(const char *, mode_t);


Joe Buck schrieb in Nachricht <>...
>> i try to get gcc 2.95.3 and only c++ to work on an old Unix System V Rel
>> 4.0.
>> the c compiler works fine, and c++ is build ok. But when i try to build
>> c++ program,
>> the linking fails (binutils 2.10.1) with
>> /usr/lib/gcc-lib/i386-pc-sysv4.0/2.95.3/ undefined reference
>> `open(char const *, int,...)'
>Some source file is invoking "open" without a prototype of the "open"
>function in scope that is marked as extern "C".  I don't know why this
>occurs.  It might be a bug in "fixincludes" for that platform, meaning
>that a header doesn't get wrapped correctly.
>You could try to isolate the individual .o file with the bad symbol
>reference to figure out why it occurs, then add the appropriate prototype
>to that file:
>extern "C" int open(const char*, int, ...);
>But this might only get you to the next bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]