Linux Users

cancel
Showing results for 
Search instead for 
Did you mean: 

HelloWorld.so First LV package on SUSE: Solving Missing Dependencies!

Hello Linux group. I am working through a problem and wanted to see if anyone has seen it before, and leave breadcrumbs/documentation if I do solve it.

hello world.png
I am trying to take a VERY BASIC subvi, hello world.vi (above) and create a Shared Library (.so file) from it. I am working on OpenSUSE and LabVIEW 2018.

 

However I get the following Error when building the .so:

Error 1 occurred at System Exec: /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status

At first I thought "oh no! GCC must not of installed libstdc++! but the following check on the Development environment returned:

zypper se libstdc++
Loading repository data...
Reading installed packages...
 
S  | Name                        | Summary                                               | Type  
---+-----------------------------+-------------------------------------------------------+--------
   | libstdc++-devel             | The system GNU C++ development files                  | package
   | libstdc++-devel-32bit       | The system GNU C++ 32bit development files            | package
i+ | libstdc++6                  | The standard C++ shared library                       | package
   | libstdc++6-32bit            | The standard C++ shared library                       | package
   | libstdc++6-devel-gcc7       | Include Files and Libraries mandatory for Development | package
   | libstdc++6-devel-gcc7-32bit | Include Files and Libraries mandatory for Development | package
   | libstdc++6-devel-gcc8       | Include Files and Libraries mandatory for Development | package
   | libstdc++6-devel-gcc8-32bit | Include Files and Libraries mandatory for Development | package
   | libstdc++6-gcc7             | The standard C++ shared library                       | package
   | libstdc++6-gcc7-32bit       | The standard C++ shared library                       | package
   | libstdc++6-gcc7-locale      | Standard C++ Library Locales                          | package
   | libstdc++6-locale           | Standard C++ Library Locales                          | package

I wonder if this problem is similar to These Threads and I am currently investigating if any of those solutions work.

 

Also, this thread from 8 years ago suggests there is a specific build of libstdc++ needed for LabVIEW. Does anyone know which version(s) are acceptable for LabVIEW 2018?

 

**Edit**

I was originally working off of this knowledge base article.

When a similar error has been present on other environments, the solution has been to create a Symantec link to the x86 libstdc package. However it is difficult to understand where LabVIEW is expecting this package to 'be' in the first place.

 

Spoiler
Side note, why does LabVIEW need the x86 components in the first place? isn't LabVIEW 2018 x64 only?
________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
0 Kudos
Message 1 of 7
(6,342 Views)

Update: I am building the 'officially suggested' SuSE distro now and re-testing. This could be the problem.

________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
0 Kudos
Message 2 of 7
(6,313 Views)

Update, problem persists. I attempted the same on a LabVIEW openSuSE 42.2 machine. Has anyone seen anything like this before? has anyone been able to get .so builds working on a different Distro/version?
process as follows:

[0] Install GCC

 

sudo zypper in gcc

[1] Install LabVIEW 2018 Linux Full from ISO

 

 

./INSTALL

 

[2] Confirm the Development Engine is running by creating a project with a helloworld.vi

 

[3] Install LabVIEW 2018 Application Builder

[4] Restart for good measure

 

[5] Try to make a shared object from hellworld.vi:

Error Log:

07/17/18 12:05:29 PM
[General]
Project: /home/nick/Documents/LabVIEW_Projects/Hello_World/Hello_World.lvproj
Target: My Computer
Build Specification: My Shared Library
OS: Linux x64 4.4.104-18.44-default

[Source Files]
/home/nick/Documents/LabVIEW_Projects/Hello_World/main.vi	Mon 16 Jul 2018 05:44:23 PM EDT	1

[ERROR]
Code:1
System Exec: /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status


[Output Files]


[Errors]
Click the link below to visit the Application Builder support page. Use the following information as a reference:

Error 1 occurred at System Exec: /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status

Possible reason(s):

LabVIEW: (Hex 0x1) An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
07/17/18 12:05:30 PM
________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
0 Kudos
Message 3 of 7
(6,293 Views)

Update: Workaround but not 'really' a solution:

 

'Build Shared Libraries' option works out of the box on CentOS-7

 

I will fix the missing dependencies on SuSE and post what-I-did later, but right now I need to get back on schedule.

When you think you are 90% done with a project you are 50% done.

________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
0 Kudos
Message 4 of 7
(6,270 Views)

@szewczak

/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lstdc++ collect2: error: ld returned 1 exit status

Sad, that we don't see the actual gcc/ld command. They must be calling it in a pretty weird way (perhaps overriding system library patches), otherwise the linker would find it.

Maybe try tracing it (strace) and check how the toolchain is called exactly.

 

Linux Embedded / Kernel Hacker / BSP / Driver development / Systems engineering
0 Kudos
Message 5 of 7
(6,259 Views)

As I run exactly in the same error on a fresh CentOS 7.6 installation,  I tried to strace labview while it was creating the shared library.

 

Error 1 occurred at System Exec: /usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status

 

I am attaching the txt file output of the strace command.

I am quite new in Linux and I am not able to extract any useful info from the file.

 

The only section that seems interesting is the following...

 

11:52:20 stat("/usr/local/natinst/LabVIEW-2018-64/AppLibs/liblvrtdark.so", {st_mode=S_IFREG|0777, st_size=11281176, ...}) = 0
11:52:20 pipe([19, 20]) = 0
11:52:20 pipe([21, 22]) = 0
11:52:20 pipe([23, 24]) = 0
11:52:20 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fecb09b0a50) = 19627
11:52:20 close(19) = 0
11:52:20 close(22) = 0
11:52:20 close(24) = 0
11:52:20 write(20, "", 0) = 0
11:52:20 close(20) = 0
11:52:20 select(1024, [21 23], [], NULL, NULL) = 1 (in [23])
11:52:20 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=19627, si_uid=1000, si_status=1, si_utime=0, si_stime=4} ---
11:52:20 read(23, "/usr/bin/ld: cannot find -lstdc+"..., 8192) = 77
11:52:20 select(1024, [21 23], [], NULL, NULL) = 2 (in [21 23])

Does it mean that the -lstdc++ should be located in ...LabVIEW-2018-64/AppLibs/..
Might be silly, but I don't know what to guess.

 

Any help/hint?

0 Kudos
Message 6 of 7
(5,965 Views)
After creating a symbolic link libstdc++.so to libstdc++.so.6 in both /usr/lib and /usr/lib64 it compiled successfully.
0 Kudos
Message 7 of 7
(2,160 Views)