LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview(Linux)2021 has an error loading the shared library

Solved!
Go to solution

On Linux system (Ubuntu20.04) I loaded a library, I can select the correct function after selecting the library path, but when I click OK, it says that I can't find the loaded library, asking me to make sure that the library path is correct, but the library path is correct, I don't know why this error occurred;

I made a series of attempts:(I will package all images, source code and libraries into attachments)

1. The operation performed to load the library is shown in the image:

企业微信截图_16981327142110.png

kongmingpeng_1-1698136370357.png

kongmingpeng_0-1698135671180.png

2.A strange phenomenon
Trying to repeat step 1, I successfully loaded the compiled library, sometimes with a different name, but the cpp was the same; But after a while, like when I took a nap and my computer wasn't turned off, I went to load the library again and found that the error from step 1 was coming up again, which made me crash😤
3.Remove a library of dds

kongmingpeng_2-1698136380521.png

So I found that libraries compiled from cpp files that don't rely on dds libraries can be loaded no matter how much time has passed; But now I don't know what is the incompatibility of the dds library I compiled that caused the loading failure, because I used the source code to compile the DLL under the window. This makes me feel very frustrated and I don't know how to solve it😢



 

0 Kudos
Message 1 of 6
(1,344 Views)

Wrong bitness?

 

64 bit dlls need LV 64 bit. 32 bit dlls need LV 32 bit.

0 Kudos
Message 2 of 6
(1,320 Views)

All Environment is 64 bit;

0 Kudos
Message 3 of 6
(1,297 Views)
Solution
Accepted by topic author kongmingpeng

Thanks guys,I found the answer to the question:

this link: How does LabVIEW's call library function node search for the path to the shared library? - NI
So I copied all the dependencies to /usr/lib and commented out the shared variables to load the libraries.

kongmingpeng_0-1698142686218.png

At this time, I went to load the library has been stable and will not report errors.But when I loaded the full functionality library, it had another error, but it should be related to other problems, I would be very grateful if anyone knew how to fix it.

企业微信截图_1698142772590.png

0 Kudos
Message 4 of 6
(1,289 Views)
Solution
Accepted by topic author kongmingpeng

Looks like the API is using mangled function names.

 

Typical for C++ functions.

 

The C++ function names contain prototype info, but they're compiler specific.

 

There (several) compiler options to prevent the export of mangled file names, but google will probably serve you better than me.

0 Kudos
Message 5 of 6
(1,269 Views)

Thanks for your reply.

I'll look it up.

0 Kudos
Message 6 of 6
(1,212 Views)