Hi,
I have a very strange linking problem under Linux.
If i run the following compilation.
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT counter.o -MD -MP -MF ".deps/counter.Tpo" -c -o counter.o counter.c; \
then mv -f ".deps/counter.Tpo" ".deps/counter.Po"; else rm -f ".deps/counter.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT dio.o -MD -MP -MF ".deps/dio.Tpo" -c -o dio.o dio.c; \
then mv -f ".deps/dio.Tpo" ".deps/dio.Po"; else rm -f ".deps/dio.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT nid.o -MD -MP -MF ".deps/nid.Tpo" -c -o nid.o nid.c; \
then mv -f ".deps/nid.Tpo" ".deps/nid.Po"; else rm -f ".deps/nid.Tpo"; exit 1; fi
gcc -g -O2 -o nid counter.o dio.o nid.o -llvrtdark -lnidaqmxbaselv -lnidaqmxbase
I get the following error when running:
./nid
ERROR! The LabVIEW RunTime Engine failed to initialize correctly.
This is usually caused by linking applications incorrectly.
Please see the AppLibs/README.shlibs file in the LabVIEW directory for
instructions on building programs using LabVIEW-built shared libraries.
LabVIEW caught fatal signal
- Received SIGSEGV
Reason: address not mapped to object
Attempt to reference address: 0x4
Segmentation fault
But if i compile withouth liblvrtdark:
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT counter.o -MD -MP -MF ".deps/counter.Tpo" -c -o counter.o counter.c; \
then mv -f ".deps/counter.Tpo" ".deps/counter.Po"; else rm -f ".deps/counter.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT dio.o -MD -MP -MF ".deps/dio.Tpo" -c -o dio.o dio.c; \
then mv -f ".deps/dio.Tpo" ".deps/dio.Po"; else rm -f ".deps/dio.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT nid.o -MD -MP -MF ".deps/nid.Tpo" -c -o nid.o nid.c; \
then mv -f ".deps/nid.Tpo" ".deps/nid.Po"; else rm -f ".deps/nid.Tpo"; exit 1; fi
gcc -g -O2 -o nid counter.o dio.o nid.o -lnidaqmxbaselv -lnidaqmxbase
Then everything works fine.
I also get the same behaviour if i link libnidaqmxbaselv , libnidaqmxbase toghether with any other library, ex libmath.
How
Does anyone howto fix this problem ?