Re: Shared Linux libraries in LabView 7.1



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.
I can't give you the solution here, but there are several issues with shared library function export.

First only on Windows does the Call Library Node have support to
enumerate the exported functions and populate the Ring Control. On all
other platforms this Ring Control is always disabled.

There are ussues about name decorations and such when compiling a C
source file with a CPP compiler. Also I've had quite some troubles in
the past to get a shared library to export its functions and fiddling
with the make file eventually made the functions available for LabVIEW
to call.

My command lines usually look somewhat like this if I remember correctly, although I usually use makefiles for this:

gcc -fPIC -I. -O3 libtest.o libtest.c
gcc  -shared -Wl, -o libtest.so libtest.o

Rolf Kalbermatter
.



Relevant Pages

  • Re: Files Stored on NTFS
    ... I can't switch between windows, no music plays, etc. CPU usage is at ... When you load a program, your kernel loads another program to actually ... shared libraries, all programs will have code in them that, for example, ... dynamically linked executables named ".ident", ...
    (alt.os.linux)
  • Re: Files Stored on NTFS
    ... I can't switch between windows, no music plays, etc. CPU usage is at ... shared libraries, all programs will have code in them that, for example, ... dynamically linked executables named ".ident", ... among other things) Linux executable use ...
    (alt.os.linux)
  • Re: Files Stored on NTFS
    ... You can say your Windows box hasn't done that, but do you know how many have? ... Except for statically-linked programs, which use no shared libraries, all programs will have code in them that, for example, calls a function in a shared library. ... The program that does this fixing up is called "ld.so", and on Linux, it exists as ... Because executables are broken into sections, and there's a section in dynamically linked executables named ".ident", which contains just one thing: ...
    (alt.os.linux)
  • Re: basic_string ref across dlls
    ... >> components should be distributed as shared libraries under Windows? ... > ties your DLL into so many things (compiler version, vendor, CRT ... And so are a million other DLLs which successfully work also. ...
    (microsoft.public.vc.stl)
  • Shared Library Unresolved References
    ... I am porting a large DLL from windows to Linux and other POSIX ... compliant operating systems. ... this is my first experience with unix shared libraries. ... Under windows, when a DLL is created, the modules are linked together. ...
    (comp.unix.programmer)