Operating System - HP-UX
1753831 Members
9405 Online
108806 Solutions
New Discussion юеВ

error #2338: more than one instance of overloaded function "signal" has "C" linkage

 
SOLVED
Go to solution
girishgawali
Occasional Advisor

error #2338: more than one instance of overloaded function "signal" has "C" linkage

Hi People,

//valid.cxx file
#if defined(VPP_MSVC20) || defined(__linux)
#ifdef VERSANT_ANSI
#include
#include
using namespace std;
#else
#include
#include
#endif /* VERSANT_ANSI */
#else

typedef void SIG_FUNC(int);
extern "C" {
extern void exit(int i);
extern void _exit(int);
extern void _mcleanup();
extern void _cleanup();
extern SIG_FUNC* signal(int,SIG_FUNC*);
extern void __dtors();
extern int getpid();
};
#endif

compiling the above code in HP-UX ITANIUM (with aCC) I am getting this error

"valid.cxx", line 103: error #2338: more than one instance of overloaded function "signal" has "C" linkage
extern SIG_FUNC* signal(int, SIG_FUNC*);

Below is the logs of compiler:

aCC -c -D__OFPROTO__ -mt -g0 +DD64 +z -DVERSANT_ANSI -I/vobs//cxx/qa/cih/class/vnih/ -I/disk/ggawali/hp11.23aCCA.06.15_64bit-dbg/private_rep/cxx/8.0.0.0/HP-U
X_64bit/dbg//sdk/include -I/disk/ggawali/hp11.23aCCA.06.15_64bit-dbg/versant_root/sdk/include -I/vobs//kernel/inc -I/vobs//../header_files/sdk/include -I/vob
s//../header_files/sm/h -I/vobs//../header_files/om/h valid.cxx -o /disk/ggawali/hp11.23aCCA.06.15_64bit-dbg/versant_root/build/class_cont_valid/_dbg/valid.o
"/disk/ggawali/hp11.23aCCA.06.15_64bit-dbg/private_rep/cxx/8.0.0.0/HP-UX_64bit/dbg//sdk/include/cxxcls/vsession.h"


I hope someone can help me to resolve this error.

Best regards!
2 REPLIES 2
Dennis Handly
Acclaimed Contributor
Solution

Re: error #2338: more than one instance of overloaded function "signal" has "C" linkage

It is illegal for you to (incorrectly) redeclare the Standard C functions. Remove these:
extern void exit(int i);
extern void _exit(int);
extern int getpid();
extern SIG_FUNC* signal(int,SIG_FUNC*);

Removing your extra signal overload may require you to use a hammer (cast) on your signal handler function for your calls to signal(2).
girishgawali
Occasional Advisor

Re: error #2338: more than one instance of overloaded function "signal" has "C" linkage

It works
thanks...