From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,552e54b8e84dae81 X-Google-Attributes: gidfee84,public From: Dan.Pop@mail.cern.ch (Dan Pop) Subject: Re: CXX header file problem Date: 1995/10/13 Message-ID: #1/1 X-Deja-AN: 117556569 sender: news@news.cern.ch (USENET News System) x-nntp-posting-host: ues5.cern.ch references: <307D9F26.41C6@llnl.gov> organization: CERN European Lab for Particle Physics newsgroups: comp.unix.osf.osf1 In <307D9F26.41C6@llnl.gov> Mark Spruiell writes: >I'm attempting to port some software to DEC OSF/1 v3.2 using >C++ V5.0-3. One of my source files includes , >which for some reason does not contain the C++'isms that most >of the other header files contain. Hence, the compiler uses >C++ linkage for the sysinfo() function and the loader winds up >with an unresolved external. That's strange, because on my system (3.2a) the declaration of sysinfo is protected by ``#if defined(__STDC__) && !defined(_KERNEL)'' so the C++ compiler doesn't "see" it at all: ues5:~/tmp 312> cat test.cc #include void foo() { sysinfo(0, (char *)0, 0L); } ues5:~/tmp 313> cxx test.cc test.cc:5: error: In this statement, "sysinfo" is not declared. Compilation terminated with errors. > >The workaround is obvious: > >extern "C" { >#include >} It won't work on my system. >But I was hoping this might have been an oversight on DEC's >part, and that a patch is available??? > >Any ideas? Yes. Patch /usr/include/sys/systeminfo.h yourself. If portability is a concern, you're out of luck, until DEC will decide to fix it. Your best chance to be portable is to provide the prototype yourself and hope that DEC won't change it when it will become visible to the C++ compiler. Dan -- Dan Pop CERN, CN Division Email: Dan.Pop@mail.cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland