Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* CXX header file problem
@ 1995-10-12  4:00 Mark Spruiell
  1995-10-13  4:00 ` Dan Pop
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Spruiell @ 1995-10-12  4:00 UTC (permalink / raw)


I'm attempting to port some software to DEC OSF/1 v3.2 using
C++ V5.0-3.  One of my source files includes <sys/systeminfo.h>,
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.

The workaround is obvious:

extern "C" {
#include <sys/systeminfo.h>
}

But I was hoping this might have been an oversight on DEC's
part, and that a patch is available???

Any ideas?

Mark Spruiell
LLNL
mes@llnl.gov



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: CXX header file problem
  1995-10-12  4:00 CXX header file problem Mark Spruiell
@ 1995-10-13  4:00 ` Dan Pop
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Pop @ 1995-10-13  4:00 UTC (permalink / raw)


In <307D9F26.41C6@llnl.gov> Mark Spruiell <mes@llnl.gov> 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 <sys/systeminfo.h>,
>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 <sys/systeminfo.h>

    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 <sys/systeminfo.h>
>}

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-10-13  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-10-12  4:00 CXX header file problem Mark Spruiell
1995-10-13  4:00 ` Dan Pop

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox