Re: Help -- ESQL C problems
Posted in 1997
}From: "131AC0000-BasuA(DR2783)231" <abasu@dr.lucent.com> }Date: Sat, 26 Apr 1997 22:30:48 GMT }X-Informix-List-Id: <news.37177> } }Here's a simple code segment I'm trying to compile: You are using ESQL/C -- not ESQL/C++ (because there isn't such a critter). You have to tell the C++ compiler that you are using C code: #ifdef __cplusplus extern "C" { #endif }#include <decimal.h> #ifdef __cplusplus } #endif }main() }{ } double dbl_val; } dec_t dec_val; } int ret_val; } ret_val = dectodbl(&dec_val, &dbl_val); }} } }dectodbl seems to be undefined when using a C++ compiler. Works fine }if I use the c compiler. Older versions of informix did not seem to }have this problem. It started with informix 7.22. } }exec /opt/SUNWspro4.1/bin/CC -I/opt/informix7.22/incl/esql main.c }-L/opt/informix7.22/lib -L/opt/informix7.22/lib/esql -lixsql -lixasf }-lixgen -lixos -lixgls -lnsl -lsocket -laio -lm }/opt/informix7.22/lib/esql/checkapi.o }Undefined first referenced } symbol in file }dectodbl(decimal*, double*) main.o Otherwise, the C++ compiler legitimately assumes that dectodbl() was compiled by a C++ compiler and that the function has type-safe linkage. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>