This is the mail archive of the gcc@gcc.gnu.org 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


Hi,

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, ...);
+}
+#else
+extern int open(const char *, int, ...);
+#endif
 extern int creat(const char *, mode_t);

 #else


Joe Buck schrieb in Nachricht <200201031831.KAA14969@atrus.synopsys.com>...
>
>> 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
any
>> c++ program,
>> the linking fails (binutils 2.10.1) with
>> /usr/lib/gcc-lib/i386-pc-sysv4.0/2.95.3/libstdc++.so: undefined reference
to
>> `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]