Re: Using dttoasc function with ESQL and C++
Posted in 1999
Tim Owens wrote: > I'm using esql with the native HP-UX C++ compiler (Informix 7.22 UC1). > > I'm adding some functionality to an existing program that uses esql > along with C++. As part of the new functionality, I would like to use > the dttoasc function. However, I get an unresolved symbol error when > the program tries to link. > > The demo dttoasc program links just fine when I use the esql script. But not when you set INFORMIXC to your C++ compiler. > But my C++ makefile doesn't work. I'm including datetime.h in an SQL > declaration, and I'm using what I think are the standard informix > libraries: > > libixsql > libixasf > libixos > libixgls Beware; that list will change when you upgrade. So, you are using the esql script to do the linking, aren't you? > Is anyone aware of any other libraries I need (or anything else > special I need to do) to use dttoasc with a C++ compiler. Most probably, you need to enclose the declaration of dttoasc() in extern "C" { ... } That may not be trivial. Your ESQL/C is certainly unaware of C++ to the extent that it does not use extern "C" anywhere. You might try looking up (and using) the esql++ script at the IIUG web site, http://www.iiug.org, which is designed to work around such nasties. I've not tested it on 7.22 or HP-UX, but there's at the least a chance it will work and if it doesn't, there's a basis from which to make it work. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>