LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 07-18-2018, 09:13 AM   #1
JHugh
Member
 
Registered: Jul 2017
Posts: 33

Rep: Reputation: Disabled
Shared object library not able to load in LabVIEW and Redhat 7.5 Linux


I am running the following:
Redhat Linux 7.5 64 bit
LabVIEW 2017 32 bit

I programmed a shared object library using Eclipse (downloaded and possibility configured by National Instruments) that worked on a cRIO running NI Linux 32 bit OS. However, when trying to port the shared object library onto my Redhat Linux machine, it does not work.

When trying to simply load the library in LabVIEW, I get the following error:
"The library selected is not valid for the current platform. For example, you are running 32-bit LabVIEW and the library might be a 64-bit library."

How can I fix this error? I'm not too familiar with C compilers for linux i.e. I've only used Eclipse without changing too many compiler settings. I do have the C code for the shared object library, so maybe (I'm not sure how) I could recompile it for Redhat 7.5 Linux?

A little more info:
I put the .so file in /usr/lib

I receive the following error when trying to install the library through the terminal so maybe it's a compiler issue?
Code:
sudo ldconfig -n -v /usr/lib
[sudo] password for hughj: 
/usr/lib:
ldconfig: /usr/lib/libTCPIPv6.so is for unknown machine 40.

	libglibmm_generate_extra_defs-2.4.so.1 -> libglibmm_generate_extra_defs-2.4.so.1.3.0
	libdbus-glib-1.so.2 -> libdbus-glib-1.so.2.2.2
	libexpat.so.1 -> libexpat.so.1.6.0
	libpciaccess.so.0 -> libpciaccess.so.0.11.1
	libavahi-glib.so.1 -> libavahi-glib.so.1.0.2
	libavahi-common.so.3 -> libavahi-common.so.3.5.3
	libglapi.so.0 -> libglapi.so.0.0.0
	libavahi-client.so.3 -> libavahi-client.so.3.2.9
	libXxf86vm.so.1 -> libXxf86vm.so.1.0.0
	libdbus-1.so.3 -> libdbus-1.so.3.14.14
	libudev.so.1 -> libudev.so.1.6.2
	libsystemd.so.0 -> libsystemd.so.0.6.0
	libxshmfence.so.1 -> libxshmfence.so.1.0.0
	libsystemd-login.so.0 -> libsystemd-login.so.0.9.3
	libsystemd-journal.so.0 -> libsystemd-journal.so.0.11.5
	libXdamage.so.1 -> libXdamage.so.1.1.0
	libsystemd-id128.so.0 -> libsystemd-id128.so.0.0.28
	libXfixes.so.3 -> libXfixes.so.3.1.0
	libsystemd-daemon.so.0 -> libsystemd-daemon.so.0.0.12
	libglibmm-2.4.so.1 -> libglibmm-2.4.so.1.3.0
	libnss_mymachines.so.2 -> libnss_mymachines.so.2
	libnss_myhostname.so.2 -> libnss_myhostname.so.2
	libgiomm-2.4.so.1 -> libgiomm-2.4.so.1.3.0
	libpamc.so.0 -> libpamc.so.0.82.1
	libsigc-2.0.so.0 -> libsigc-2.0.so.0.0.0
	libpam_misc.so.0 -> libpam_misc.so.0.82.0
	libpam.so.0 -> libpam.so.0.83.1
	libdb-5.3.so -> libdb-5.3.so
	libGL.so.1 -> libGL.so.1.2.0
	libcrack.so.2 -> libcrack.so.2.9.0
	libkms.so.1 -> libkms.so.1.0.0
	libcap.so.2 -> libcap.so.2.22
	libattr.so.1 -> libattr.so.1.1.0
	libdrm_radeon.so.1 -> libdrm_radeon.so.1.0.1
	libauparse.so.0 -> libauparse.so.0.0.0
	libdrm_nouveau.so.2 -> libdrm_nouveau.so.2.0.0
	libaudit.so.1 -> libaudit.so.1.0.0
	libdrm_intel.so.1 -> libdrm_intel.so.1.0.0
	libcap-ng.so.0 -> libcap-ng.so.0.0.0
	libdrm_amdgpu.so.1 -> libdrm_amdgpu.so.1.0.0
	libdw.so.1 -> libdw-0.170.so
	libdrm.so.2 -> libdrm.so.2.4.0
	libgcrypt.so.11 -> libgcrypt.so.11.8.2
	liblzma.so.5 -> liblzma.so.5.2.2
	libsepol.so.1 -> libsepol.so.1
	libblkid.so.1 -> libblkid.so.1.1.0
	libasm.so.1 -> libasm-0.170.so
	libpcreposix.so.0 -> libpcreposix.so.0.0.1
	libpcrecpp.so.0 -> libpcrecpp.so.0.0.0
	libpcre32.so.0 -> libpcre32.so.0.0.0
	libpcre16.so.0 -> libpcre16.so.0.2.0
	libpcre.so.1 -> libpcre.so.1.2.0
	libuuid.so.1 -> libuuid.so.1.3.0
	libstdc++.so.6 -> libstdc++.so.6.0.19
	libzip.so.2 -> libzip.so.2.1.0
	libgpg-error.so.0 -> libgpg-error.so.0.10.0
	libz.so.1 -> libz.so.1.2.7
	libXinerama.so.1 -> libXinerama.so.1.0.0
	libX11-xcb.so.1 -> libX11-xcb.so.1.0.0
	libelf.so.1 -> libelf-0.170.so
	libxcb-xvmc.so.0 -> libxcb-xvmc.so.0.0.0
	libxcb-xv.so.0 -> libxcb-xv.so.0.0.0
	libgthread-2.0.so.0 -> libgthread-2.0.so.0.5400.2
	libxcb-xtest.so.0 -> libxcb-xtest.so.0.0.0
	libxcb-xselinux.so.0 -> libxcb-xselinux.so.0.0.0
	libgobject-2.0.so.0 -> libgobject-2.0.so.0.5400.2
	libxcb-xkb.so.1 -> libxcb-xkb.so.1.0.0
	libxcb-xinput.so.0 -> libxcb-xinput.so.0.1.0
	libgmodule-2.0.so.0 -> libgmodule-2.0.so.0.5400.2
	libxcb-xinerama.so.0 -> libxcb-xinerama.so.0.0.0
	libglib-2.0.so.0 -> libglib-2.0.so.0.5400.2
	libxcb-xfixes.so.0 -> libxcb-xfixes.so.0.0.0
	libxcb-xf86dri.so.0 -> libxcb-xf86dri.so.0.0.0
	libgio-2.0.so.0 -> libgio-2.0.so.0.5400.2
	libxcb-xevie.so.0 -> libxcb-xevie.so.0.0.0
	libbz2.so.1 -> libbz2.so.1.0.6
	liblz4.so.1 -> liblz4.so.1.7.5
	libffi.so.6 -> libffi.so.6.0.1
	libxcb-screensaver.so.0 -> libxcb-screensaver.so.0.0.0
	libselinux.so.1 -> libselinux.so.1
	libmount.so.1 -> libmount.so.1.1.0
	libxcb-sync.so.1 -> libxcb-sync.so.1.0.0
	libthread_db.so.1 -> libthread_db-1.0.so
	libxcb-randr.so.0 -> libxcb-randr.so.0.1.0
	librt.so.1 -> librt-2.17.so
	libresolv.so.2 -> libresolv-2.17.so
	libxcb-present.so.0 -> libxcb-present.so.0.0.0
	libpthread.so.0 -> libpthread-2.17.so
	libxcb-dri3.so.0 -> libxcb-dri3.so.0.0.0
	libnss_nisplus.so.2 -> libnss_nisplus-2.17.so
	libXext.so.6 -> libXext.so.6.4.0
	libnss_dns.so.2 -> libnss_dns-2.17.so
	libxcb-dri2.so.0 -> libxcb-dri2.so.0.0.0
	libnss_db.so.2 -> libnss_db-2.17.so
	libxcb-dpms.so.0 -> libxcb-dpms.so.0.0.0
	libnss_compat.so.2 -> libnss_compat-2.17.so
	libxcb-shm.so.0 -> libxcb-shm.so.0.0.0
	libnsl.so.1 -> libnsl-2.17.so
	libxcb-damage.so.0 -> libxcb-damage.so.0.0.0
	libxcb-shape.so.0 -> libxcb-shape.so.0.0.0
	libm.so.6 -> libm-2.17.so
	libxcb-glx.so.0 -> libxcb-glx.so.0.0.0
	libdl.so.2 -> libdl-2.17.so
	libxcb-composite.so.0 -> libxcb-composite.so.0.0.0
	libcrypt.so.1 -> libcrypt-2.17.so
	libcidn.so.1 -> libcidn-2.17.so
	libgcc_s.so.1 -> libgcc_s-4.8.5-20150702.so.1
	libxcb-res.so.0 -> libxcb-res.so.0.0.0
	libc.so.6 -> libc-2.17.so
	libXau.so.6 -> libXau.so.6.0.0
	libxcb-render.so.0 -> libxcb-render.so.0.0.0
	libanl.so.1 -> libanl-2.17.so
	libmemusage.so -> libmemusage.so
	libSegFault.so -> libSegFault.so
	libpcprofile.so -> libpcprofile.so
	libnss_files.so.2 -> libnss_files-2.17.so
	libBrokenLocale.so.1 -> libBrokenLocale-2.17.so
	libnss_hesiod.so.2 -> libnss_hesiod-2.17.so
	ld-linux.so.2 -> ld-2.17.so
	libxcb-record.so.0 -> libxcb-record.so.0.0.0
	libfreeblpriv3.so -> libfreeblpriv3.so
	libfreebl3.so -> libfreebl3.so
	libutil.so.1 -> libutil-2.17.so
	libX11.so.6 -> libX11.so.6.3.0
	libnss_nis.so.2 -> libnss_nis-2.17.so
	libxcb.so.1 -> libxcb.so.1.1.0
/usr/lib/sse2: (hwcap: 0x0000000004000000)
/usr/lib/i686: (hwcap: 0x0008000000000000)
Thanks!

Last edited by JHugh; 07-18-2018 at 09:46 AM. Reason: Added more info
 
Old 07-19-2018, 02:02 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,849

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
would be nice to execute:
file /usr/lib/libTCPIPv6.so
file /usr/lib/<some other so>, like ld-2.17.so

I think all of them 64bit libraries, therefore cannot be used with a 32bit app, like your LabVIEW.
You ought to compile that lib in 32bit mode or download/install it from the net.
Probably you only need to check eclipse there should be an option somewhere to configure the target platform.
 
Old 07-19-2018, 07:16 AM   #3
JHugh
Member
 
Registered: Jul 2017
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
would be nice to execute:
file /usr/lib/libTCPIPv6.so
file /usr/lib/<some other so>, like ld-2.17.so

I think all of them 64bit libraries, therefore cannot be used with a 32bit app, like your LabVIEW.
You ought to compile that lib in 32bit mode or download/install it from the net.
Probably you only need to check eclipse there should be an option somewhere to configure the target platform.
That could be it, since I compiled for an NI cRIO 32bit Linux board.

I'm not very familiar with Eclipse. What settings should I use to compile for RedHat 7.5 64bit running LabVIEW 2017 32bit? When I searched on the web, it said I should use the -m32 flag, but my Eclipse will not compile if I use that.

I cannot download the lib from the web because it is a custom C code that I wrote for LabVIEW.

Any chance I can post the code (only two files a .c and a .h) and someone who understands compiling better compiles it for my system and sends me the shared object library? That or explain what settings I should use?

Thanks.
 
Old 07-19-2018, 07:21 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,849

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
so you have a single .c and .h file?
that you can use a simple makefile to build it.
Code:
CC=gcc
LD=gcc
OBJECTS=yourfile.o

.c.o:
    $(GCC) -W all -o $@ -c $< # begins with tab

libTCPIPv6.so: $(OBJECTS)
    $(LD) -shared -o $@ $(OBJECTS) # begins with tab
https://www.cprogramming.com/tutoria...linux-gcc.html
http://codechunks.org/blog/2012/10/2...hared-library/

or just simply execute:
Code:
gcc -o file.o -c file.c
gcc -shared -o libXXX.so file.o
also you may need to add -m32 to gcc.
These are not tested, so probably you need to check how it really works.

Last edited by pan64; 07-19-2018 at 07:28 AM.
 
1 members found this post helpful.
Old 07-19-2018, 08:55 AM   #5
JHugh
Member
 
Registered: Jul 2017
Posts: 33

Original Poster
Rep: Reputation: Disabled
Thanks! That worked!

I'm now running into a new issue, but it's more of a networking problem, so I'll post it in a different subforum.
 
Old 07-19-2018, 09:24 AM   #6
JHugh
Member
 
Registered: Jul 2017
Posts: 33

Original Poster
Rep: Reputation: Disabled
It's able to load, but I'm running into a Networking problem which I posted here: https://www.linuxquestions.org/quest...de-4175634450/

Though maybe it's a compiling problem since it worked fine between a Windows 10 PC and an NI cRIO running NI Linux.

Would building it through the terminal like that generate error messages if it cannot find the proper includes?

I'm including these:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

#include <arpa/inet.h>

#include <errno.h>
#include <fcntl.h>
 
Old 07-20-2018, 12:35 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,849

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
as it was told: post the relevant code, commands you tried and the response. Exactly.
 
Old 07-20-2018, 08:01 AM   #8
JHugh
Member
 
Registered: Jul 2017
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
as it was told: post the relevant code, commands you tried and the response. Exactly.
Thanks!

Will do.

I'll post the code on my other post, so this one I can mark solved.

Thanks for you help!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Save/Load data segment of Dynamically loaded Shared Object library vragukumar Programming 3 08-26-2010 11:29 AM
Shared object constructor not called when library loaded adevi003 Programming 2 10-12-2009 04:51 AM
shared library : libfg.so: cannot open shared object file error 40 x_gaurav Programming 2 06-28-2009 06:29 AM
Shared object library that uses another shared object library Nightfox Programming 1 02-15-2006 10:00 PM
shared object library won't load (libstdc++) sleepylight Linux - General 4 04-27-2004 04:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 05:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration