LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

linux calling labview

I have created a simple shared library (.so) file with the Linux application builder. Are there any examples of how to call this library from a c/c++ program. Should I use a specific compiler (gcc?) How should I link to this .so file? I keep getting errors about missing functions or the following error if I do get it to compile:

LabVIEW caught fatal signal
6.0Received SIGSEGV
Reason: address not mapped to object

Maybe I need to make/change some enviromental variables?
0 Kudos
Message 1 of 3
(2,709 Views)
I am not familiar with the Linux Application builder, or Linux shared libraries. You also didn't mention if this was LabVIEW code built with the LabVIEW for Linux application builder, but I assume that since you are posting here, that it was...

If this was a true Linux type shared library, then you won't be able to find any information about calling it on this forum. Try checking out gcc and other linux programming forums for how to call this shared library.

Also, try contacting NI support. If this is a linux shared library compiled from LabVIEW code, they may be able to offer some assistance. Start at ni.com/ask or ni.com/linux.
0 Kudos
Message 2 of 3
(2,709 Views)
There is a document that is shipped with LabVIEW called "Using external Code in LabVIEW". It contains information about settings needed to create shared libraries with Gnu C and C++ compilers on Linux. You can find it on LabVIEW 6.1 by going to help >> search the LabVIEW bookshelf. This launches a pdf of all the shipping documents and you should find "Using External Code in LabVIEW" there.

I found the following suggestion on our internal database:

Explicitly link against the thread library in your Makefile. For example, the link line
in the Makefile in the attached customer archive should be changed to:

${CXX} ${CXXFLAGS} ${LIBFLAGS} -o smtest smtest.o -lSharedLib -llvrt -lthread

Note also that "-llv" has been deleted. This library is not intend
ed to be linked against; it is used
only by the lvsbutil utility when building CIN's.


_____________________________________________________



There is also some information on our advanced search page. Goto www.ni.com >> support >> advanced search (it is at the bottom--click on the words). This launches the best way to search our site for support. Enter shared library linux labview in the all the words field and search everything.

Jeremy Braden
National Instruments
0 Kudos
Message 3 of 3
(2,709 Views)