This is a discussion on Erratic behvaiour of dlopen AIX within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi, I have an application which talks to the database using the ODBC APIs. In this I use the ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I have an application which talks to the database using the ODBC APIs. In this I use the dlopen function to open the ODBC driver manager(libodbc.so) which generally is a .so file(on Solaris, Linux) On AIX I donnot have a .so file but have a libodbc.a which internally maps to another file called the odbc.so (which has all the symbols which generally should be present under the libodbc.so) In the app I try to open the libodbc.so using the dlopen which is succesfully executed. All the calls to the dlsym function are also successful. But None of the functions which are part of the ODBC driver are working. I have read on the net that there are some problems with the usage of the shared objects on the AIX machine. My questions: 1) Since I donnot have a .so (libodbc.so) file is it right to pass this as an argument to the dlopen function 2) How is it that the dlopen and the slsym function are not giving errors and still I am not able to use the function present in the library 3) Is there any work around to make this work |
| ||||
| phil_pp1@yahoo.com (Philips P) writes: > I have an application which talks to the database using the ODBC APIs. > In this I use the dlopen function to open the ODBC driver > manager(libodbc.so) which generally is a .so file(on Solaris, Linux) > On AIX I donnot have a .so file but have a libodbc.a which internally > maps to another file called the odbc.so Huh? What do you mean "internally maps"? I suspect libodbc.a simply *contains* odbc.so (you can verify this with "ar tv libodbc.a"), in which case you should be calling dlopen("libodbc.a(odbc.so)", RTLD_LAZY|RTLD_MEMBER); > In the app I try to open the libodbc.so using the dlopen which is > succesfully executed. This will *not* open libodbc.a. If it returns success, then somewhere on your system you have libodbc.so, which may not be the library you want to dlopen(). > All the calls to the dlsym function are also > successful. But None of the functions which are part of the ODBC > driver are working. Perhaps libodbc.so contains "do-nothing" stubs, and was intended for something else? > I have read on the net that there are some problems with the usage of > the shared objects on the AIX machine. There are no problems with "usage of shared objects" on AIX. It's just that they work differently from every other UNIX. > 1) Since I donnot have a .so (libodbc.so) file is it right to pass > this as an argument to the dlopen function No. See above. > 2) How is it that the dlopen and the slsym function are not giving > errors and still I am not able to use the function present in the > library See above. > 3) Is there any work around to make this work Yes: if you want to open libodbc.a, you must call dlopen() with correct parameters. Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. |