Need help using Informix inside shared object libraries on SUN
Posted in 1996
Topics: Server Administration
We're trying to develop an application that calls functions located inside a shared object (.so) library. These functions, in turn, access a small Informix database that we've also designed. For various reasons, we have to be able to completely contain all the Informix stuff inside the shared library. We cannot let the main application "know" it is dealing with Informix, only with the shared library. I think I've built the .SO file OK, at least I don't get any compile or link errors. I'm =am= linking the Informix libgen.a, libsql.a and libos.a into the shared object library, along with my other functions that access the database. However, when I link the main application to only the shared object library, I get a fatal link error, reporting two undefined symbols: "sqlca" and "_iqdbase". But if I also include the three Informix libraries, the link succeeds and the application runs perfectly. I would have thought that it would not be necessary to link the application itself to the Informix libraries, since they are contained in the .SO library. And, as I stated above, our task requires that they =NOT= be linked to the application. Informix was not able to help us out when we reported this. It appeared that they had no information regarding this situation. Other people we have talked to have suggested the possibility that the undefined symbols are globals that Informix expects to be located in the main application. Also that there might be some other way to build the .SO library so that the need for the globals will be satisfied within the .SO itself. We're really begining to feel that we simply may be trying to do something that Informix (Online 5.0) just isn't capable of handling. If so, we need to find out so we can implement a non-Informix alternative. Can anyone out there shed any light on this? Thanks!!!