From: Sven B. <Sve...@s2...> - 2006-06-14 21:53:36
|
Hi, I'm Sven and together with some other students I'm currently writing on a tool which consists of mainly 3 parts: A backend to handle a database connection, a main library which does all the management stuff and a webinterface. The webinterface is (or will be) written in Perl, the library and the backend lib in C. Once the webinterface is called it will tell the library which backend to load (because we plan to support different databases) and the library will then try to load the backend. The backend will then call the register function of the library to add itself to the backend list. Its a simple task and it works if I replace the Perl frontend with a simple C program. But when I use the Perl program with the library generated by Swig the backend tells me, that it can't find the register function of the library. As an workaround, I can link the library against the backend, but the student who programs on the lib thinks that this is dirty (maybe it is, but at the moment it is the only way that works with the Swig generated lib). So to show you the problem I have written a little example program which will show you the problem. I've put it on: http://www-user.tu-chemnitz.de/~basv/libproblem.tgz The following steps are necessary to compile it: tar -vzxf libproblem.tgz cd libproblem make After that, you can try to execute: ./test_c This is the demo application in C which works fine on my and somebody others system. The perl version which does not work is: perl test_perl.pl It should say: "undefined symbol: libregister" To get it work add the following to line 13 in the Makefile: -L. -lproblem Then type: make clean all && perl test_perl So, is there another way to get it working in the same way as the C application does? Thanks in advance, Sven |