03-29-2010 02:04 AM - edited 03-29-2010 02:06 AM
cc -I/usr/local/natinst/nidaqmxbase/include -I/usr/local/natinst/LabVIEW-2009/cintools build/square.so test.c -o test
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream >& std::basic_istream >::_M_extract(float&)@GLIBCXX_3.4.9'
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream >& std::basic_istream >::_M_extract(double&)@GLIBCXX_3.4.9'
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream >& std::basic_istream >::_M_extract(double&)@GLIBCXX_3.4.9'
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_ostream >& std::basic_ostream >::_M_insert(double)@GLIBCXX_3.4.9'
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream >& std::basic_istream >::_M_extract(float&)@GLIBCXX_3.4.9'
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_ostream >& std::basic_ostream >::_M_insert(double)@GLIBCXX_3.4.9'
collect2: ld returned 1 exit status
make: *** [test] Error 1
Running ldd reveals that liblvrtdark.so.9.0 is being used for the labview runtime.
In order to investigate what might be causing the problem, I compiled one of the nidaqmx base examples, and I didn't get an error. Running ldd as reveals that it uses liblvrtdark.so.8.2 for the lab view run time.
My suspicions is that some labview components are being compiled with gcc 3.4 while others are being compiled with gcc 4.1 (which is the default compiler in RHEL 5).
Any ideas how I might resolve these build errors?
Thanks in advance for any suggestions.
PS.
I have attached a tar file with the source files and following are the details from ldd:
ldd build/square.so
linux-gate.so.1 => (0x008de000)
liblvrtdark.so.9.0 => /usr/local/lib/liblvrtdark.so.9.0 (0x00b9c000)
libc.so.6 => /lib/libc.so.6 (0x00110000)
libstdc++.so.6 => /usr/local/lib/LabVIEW-2009/patchlib/libstdc++.so.6 (0x009a7000)
libm.so.6 => /lib/libm.so.6 (0x00756000)
libdl.so.2 => /lib/libdl.so.2 (0x00256000)
libpthread.so.0 => /lib/libpthread.so.0 (0x0025a000)
/lib/ld-linux.so.2 (0x00b80000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00272000)
ldd /usr/local/natinst/nidaqmxbase/lib/libnidaqmxbase.so.3.3.0
linux-gate.so.1 => (0x00e50000)
libnidaqmxbaselv.so => /usr/local/lib/libnidaqmxbaselv.so (0x00248000)
libc.so.6 => /lib/libc.so.6 (0x00689000)
/lib/ld-linux.so.2 (0x00b80000)
liblvrtdark.so.8.2 => /usr/local/lib/liblvrtdark.so.8.2 (0x00e51000)
libdl.so.2 => /lib/libdl.so.2 (0x00813000)
libpthread.so.0 => /lib/libpthread.so.0 (0x001b0000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x009c7000)
libm.so.6 => /lib/libm.so.6 (0x00b0a000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0050c000)
Solved! Go to Solution.
03-30-2010 11:43 AM
I have done some research on this and the f2 patch for LabVIEW fixed with the project and building libraries, applications, and etc. I would try this first to see if this fixes the issue and the link to it is below:
http://digital.ni.com/public.nsf/allkb/C3F88F3596A164AD86257647006FB022
JimS
03-31-2010 08:09 PM
Hi JimS,
Thanks for the suggestion. I applied the patch successfully [LabVIEW version number now displays as 9.0f2 (32-bit)], however I am still getting the same link errors.
I've also filled out a bug report (Reference#9412-6H5721) for this issue.
Cheers,
R
04-01-2010 06:11 PM
Sorry to hear that updating LabVIEW didn't fix the issue. I am a bit confused why you think that the labview components are compiled with gcc 3.4 instead of gcc 4.1. Also I saw that at the end of the build errors is says Error 1. Is there an explanation to that error?
I am going to try to run this code on a linux machine that we have hear. I'll post if it works or not.
JimS
04-06-2010 01:26 AM
Hi JimS,
I'm happy to report that I managed to get the code working. I've included some of the steps I went through to solve the issue in case this might help to improve documentation or future builds.
In response to your query about the "Error 1" reported by make, it is just an indication that make detected an error from the compiler (it probably looks at the return code from the compiler).
The errors "undefined reference ... @GLIBCXX_3.4.9" were narrowed down. The labview generated shared library, square.so, links to /usr/local/lib/LabVIEW-2009/patchlib/libstdc++.so.6 which is a symlink to /usr/local/lib/LabVIEW-2009/patchlib/libstdc++.so.6.0.9. I decided to compare this version of libstdc++ to the one included with RHEL:
strings /usr/local/lib/LabVIEW-2009/patchlib/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_FORCE_NEW
strings /usr/lib/libstdc++.so.6 | grep GLIBCXXSo RedHat's libstdc++ doesn't include a string for GLIBCXX_3.4.9.
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_FORCE_NEW
.PHONY: all clean
CPPFLAGS=-I/usr/local/natinst/nidaqmxbase/include -I/usr/local/natinst/LabVIEW-2009/cintools
LDFLAGS=build/square.so \
/usr/local/lib/LabVIEW-2009/patchlib/libstdc++.so.6 \
-Wl,--rpath -Wl,/usr/local/lib/LabVIEW-2009/patchlib/
all: test
clean:
rm -f test *.o
./test: error while loading shared libraries: /usr/local/lib/liblvrtdark.so.9.0: cannot restore segment prot after reloc: Permission denied