Re: Informix 6.0 ESQL C++ problem???
Posted in 1994
In article <35cjct$6of@athos.cc.bellcore.com>, fox,james p <foxj@moscow.cc.bellcore.com> wrote: >Hi, > We're having a problem converting our C++ ESQL code from >Informix 5.0 to Informix 6.0. For 5.0 we had our own >header file to define the informix functions such as "iqdbase()" >as extern "c". Now in 6.0 informix defines them in their >ESQL header file so we had to take them out of ours. Now >we have a link problem with these functions as it looks like >the linker is looking for the C++ functions like "iqdbase_FPci()". >We are using SunOS 5.3. > >Any ideas, >jim >foxj@cc.bellcore.com > Since C++ is going to mangle the names of external symbols, for namespace support, you must modify the Informix Headers to use the extern "C" syntax. For example: #if defined( c_plus_plus ) extern 'C' { #endif stuff ..... ..... #if defined( c_plus_plus ) } #endif Note that the symbol c_plus_plus is my recollection with out checking what the C++ compiler defines. This puts each function into the global namespace, preventing the mangling of the function names by the compiler. Enjoy, -Greg