Re: PRO*C

From: Vivekanandhan Raja <vraja_at_us.oracle.com>
Date: 1995/12/29
Message-ID: <4bvopq$opj_at_inet-nntp-gw-1.us.oracle.com>#1/1


Hi Paulo,

  The problem you are seeing is due to name-mangling in C++. All C++ functions get decorated with their argument types (typically). This causes grief if some of the modules are written in C.

   Wrap the header for SQLLIB functions ( I am not sure of the filename on your port) within an extern "C" wrapper. In fact, you must resort to this whenever you include prototypes for any C functions in a C++ file. You must also wrap any defined variables and functions within the C++ file in extern "C" wrappers if these are to be seen by other .C files.

e.g.

<-------------- The C++ file --------------------->
extern "C"
{

#include <sqllib header>
#include <prototype for other C functions> }

extern "C"
{

  int my_c_var ;

}

<-------- the .C  file -------------------------->

extern int my_c_var ; Received on Fri Dec 29 1995 - 00:00:00 CET

Original text of this message