Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: signal in C++ Message-ID: <694@taumet.com> Date: 25 Apr 91 18:43:23 GMT References: <6475@male.EBay.Sun.COM> Organization: Taumetric Corporation, San Diego Lines: 27 chrisdc@mykids.EBay.Sun.COM (chris chang) writes: >I am writing a C++ code under SunOS, am having a problem with using >signal. When I link the program, I get the following undefined >symbol from the loader: __signal__FiPFv_v. Any idea? Also, what is >the correct syntax for declaring the signal function prototype? Boy, do we need a FAQ. Any volunteers? If someone will write it up and maintain it, I will volunteer to review it. You need to declare C library functions with extern "C" Otherwise, the C++ compiler assumes they are C++ functions and assumes a mangled name (type-safe linkage). If you try to use the C header files that come with SunOS, they do not have prototypes, but use old-style C declarations. These are unusable with C++. I am told that Sun C++ comes with its own set of header files with correct C++ prototypes for all system functions (I have no direct experience with Sun C++ however). You don't say which C++ you are using. If it doesn't supply C++ versions of the system include files, you will have to write your own, put them in a convenient place, and use the -I directive to get at them ahead of the standard include files. -- Steve Clamage, TauMetric Corp, steve@taumet.com