Linux Users

cancel
Showing results for 
Search instead for 
Did you mean: 

link error on Centos 5.3 - LabVIEW2009

Hi all,

I am trying/failing to compile a labview program without gui according to the instructions on http://digital.ni.com/public.nsf/allkb/5D6EC36DCF43343786257449006919E6 (create shared library, compile with very simple c source file) . BTW, the program runs fine WITH gui.

My system is a fresh install of Centos 5.3 with LabVIEW2009.

The error occurs when I run :

gcc -g -o KantelSerCom KantelSerCom.c ./KantelTafel.so -L /usr/local/natinst/LabVIEW-2009/AppLibs/liblvrtdark.so.9.0.0 -I /usr/local/natinst/LabVIEW-2009/cintools

The error is:

/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream<char, std::char_traits<char> >& std::basic_istream<char, std::char_traits<char> >::_M_extract<float>(float&)@GLIBCXX_3.4.9'
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream<char, std::char_traits<char> >& std::basic_istream<char, std::char_traits<char> >::_M_extract<double>(double&)@GLIBCXX_3.4.9'
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream<wchar_t, std::char_traits<wchar_t> >& std::basic_istream<wchar_t, std::char_traits<wchar_t> >::_M_extract<double>(double&)@GLIBCXX_3.4.9'
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::_M_insert<double>(double)@GLIBCXX_3.4.9'
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_istream<wchar_t, std::char_traits<wchar_t> >& std::basic_istream<wchar_t, std::char_traits<wchar_t> >::_M_extract<float>(float&)@GLIBCXX_3.4.9'
/usr/local/lib/liblvrtdark.so.9.0: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::basic_ostream<char, std::char_traits<char> >::_M_insert<double>(double)@GLIBCXX_3.4.9'
collect2: ld returned 1 exit status

In addition to the instructions on the website mentioned above I added '-I /usr/local/natinst/LabVIEW-2009/cintools' on the compiler line to avoid the following error:

In file included from KantelSerCom.c:1:
KantelTafel.h:1:21: error: extcode.h: No such file or directory.


Apparently, the liblvrtdark.so is linked against a version of glibc that is not present, or not used, on my computer. That is what I understand from my searches on the web. However, I cannot find a 'working' glibc alternative in the Centos distribution.

Is it at all possible to compile labview on my system, or am I missing something? Any suggestions?

greetings,

Tom Welter

0 Kudos
Message 1 of 3
(6,223 Views)

Tom,

This is really an issue with Red Hat Enterprise 5 (and it derivatives like CentOS) only ship a version of libstdc++ of 6.0.8. The compiler that LabVIEW uses (gcc-4.2.1), uses libstdc++.so.6.0.9. It is actually fairly simple to resolve this issue. At the end of your command line, add and modify the following:

gcc -g -o KantelSerComKantelSerCom.c ./KantelTafel.so -L/usr/local/natinst/LabVIEW-2009/AppLibs/liblvrtdark.so.9.0.0 -I/usr/local/natinst/LabVIEW-2009/cintools -Wl,-rpath,'$ORIGIN',-rpath,'/usr/local/lib/LabVIEW-2009/patchlib'

This will link directly to your shared object library (SO) and not the RTE since your SO will dynamically load the correct Run-Time Engine (I assumed that you checked the check box in the Advanced Settings tab to get the Embedded Run-Time Engine). It will then load your SO first looking in the same directory as your executable. It will also load libstdc++ from the /usr/local/lib/LabVIEW-2009/patchlib directory before the system location and you will be guaranteed to get the version we ship with LabVIEW to make sure LabVIEW works on those systems with less than libstdc++.so.6.0.9.

We have to do the same procedure starting with LabVIEW 2009 to test the dark (without GUI) Run-Time Engine on Red Hat Enterprise systems.

Randy Hoskin

LabVIEW for Linux

0 Kudos
Message 2 of 3
(4,204 Views)

Hi Randy,

Wauw! That was quick and definitive! Your suggestion solved the problem. I feared that it would be something like this, but I did not know how to deal with it. The program is compiling, linking and currently running happily 🙂 Thanks a lot for your reply.

regards,

Tom

0 Kudos
Message 3 of 3
(4,204 Views)