11-20-2005 07:50 AM
11-21-2005 04:24 AM
11-21-2005 06:26 AM
11-21-2005 09:00 AM
I can't give you the solution here, but there are several issues with shared library function export.
@Raistlin wrote:
We are trying to transfer a rather large application from Windows to Linux. The major problem I seem to encounter is the use of shared libraries. We wrote a large part of our software in C, but when I try to make a shared library I do not succeed to export the functions. A first simple test file (with a meaningless little function) already gave the problem of not exporting the function in the shared library to LabVIEW. Not only are the functions not listed when configuring the Call Library Function node, typing the function name and providing the right arguments still gives the message that the function was not found.
The source code was the following :
long first(long a);
long first(long a) {
long b;
b = a;
return b;
}
The command :
gcc -fPIC -shared -o libtest.so firstso.c
Are any extra compilation flags or keywords required ? I already tried a whole bunch (including visibility attributes), but the problem remains the same.
11-21-2005 09:15 AM
I will give the 'fiddling' a try. I thought name decorations would not be an issue since no classes or anything are used. I suppose compiling a library and calling it from another C code might help me. I'll take a look at it.
I left the Makefile out for now, but off course it will be necessary for the whole project. And about the stander gnu linker, if I take a look at it it seems this only seems to be relevant for Solaris. Can anyone confirm this, so I don't need to give this any attention ?
08-17-2006 03:43 AM
08-18-2006 03:12 AM
Thanks Raistlin for posting this. It would not have occurred to me to suggest checking this, eventhough I know from other Opn Source projects that this is a very common problem trying to create 32bit components on a 64bit Linux distribution, without having the entire 32bit toolchain setup correctly too.
@Raistlin wrote:
After a long time I would like to give an update on this issue. I picked up this conversion again lately, and noticed I was working on x64 distribution without being aware of it. This explains why LabVIEW could not access the library. Everything works fine now with 4.0, and I'm sure the conversion to 4.1 will also be smooth.
08-18-2006 03:24 AM - edited 08-18-2006 03:24 AM
Message Edited by Raistlin on 08-18-2006 03:25 AM