LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with C++ library call with Labview/linux.

HI,

I'm working under LV for Macintosh and for linux.

While I'm porting a vi, which is calling C and C++ code, developped
under MAC, and ported to Linux, I get the following problem:

Under Linux, the static object constructors of the library are not
called during the load period of LabVIEW (which is done while the VI's
are loaded on mac.)

From there, I get a crash of LabVIEW (Segmentation fault) at the first
access of a static object.

I compile the files .cc with the following options:

g++ -fPIC -shared -I -o f.o f.cc

The link is done with that command:

ld -fPIC -shared -u __pure_virtual\
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/crtbeginS.o \
-l stdc++ \
/usr/lib/gcc-lib/i386
-redhat-linux/egcs-2.91.66/libgcc.so \
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/crtendS.o \
-o RUlib.dll

LabVIEW does find all the functions in the libraries (it agrees to run),
but doesn't call at all the constructors during library load.

Under Macintosh, I've encounter the same problem, but I could solve it
in choosing the right entry points of the library in the compiling
option. (initilisation = __initialize, main = '' termination = __terminate).

Thanks to let me know

Eric Cano
0 Kudos
Message 1 of 2
(2,776 Views)

Sorry for necro'ing an old thread. But I have the same issue in labview 8.2 in Linux. Calling natively compiled applicationsin system exec causes segmentation faults.

 

Anyone have any experience with this?

 

I believe I found the issue. You need to configure the application to recieve data from STDIN if you don't the application will crash, this solved my issue.

0 Kudos
Message 2 of 2
(2,165 Views)