LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-18-2019, 05:04 AM   #1
schmi85
LQ Newbie
 
Registered: Sep 2018
Distribution: win65
Posts: 15

Rep: Reputation: Disabled
tricky compilation and run


I have obtained an NFC reader. Together with this reader I obtained an SDK, which basically has this directory layout:

PHP Code:
/home/pi/SDK/
  +/
Examples/One/main.cpp
  
+/Libraries/Linux/One/
    +
libThinLayer.so.1.0.1
    
+/include
      +
some .h files
  
+/bin 
to compile the first example I used this command:

PHP Code:

$pwd
/home/pi/SDK/

$g++ \
  -
./bin/one \
  -
./Libraries/Linux/One/include \
  -
L/home/pi/SDK/Libraries/Linux/One \
  -
l:libThinLayer.so.1.0.1 \
  ./
Examples/One/main.cpp 
But that did not succeed since the compiler stopped with this message:

PHP Code:
/usr/bin/ldwarninglibcrypto.so.1.0.0needed by ./Libraries/Linux/One/libThinLayer.so.1.0.1not found (try using -rpath or -rpath-link
Going further down on this, I noticed that »libcrypto.so.1.0.0« is part of the openssl package, which is actually installed on that system, but in a newer version.

PHP Code:
ldconfig -grep -i libcrypto
    libcrypto
.so.1.1 (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1 
That led me here where somebody suggested to create a symlink like so:

PHP Code:
$cd /home/pi/SDK/Libraries/Linux/One/
$ln -/usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1 libcrypto.so.1.0.0

$ls 
-la
libcrypto
.so.1.0.0 -> /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1 
So, than, I digged deeper and deeper and finally cam up with this:

PHP Code:
$pwd
/home/pi/SDK/

export LIB=$(pwd)/Libraries/Linux/One

g
++ \
  
Examples/One/main.cpp \
  -
o bin/thin \
  -
I$LIB/include \
  -
L$LIB \
  -
Wl,-rpath=$LIB  \
  -
l:libThinLayer.so.1.0.1 \
  -
l:libcrypto.so.1.0.0 
This way the compilation actually succeeded. But

PHP Code:
bin/thin
bin
/thinerror while loading shared librarieslibcrypto.so.1.0.0cannot open shared object fileNo such file or directory 
So the library is missing at runtime.

Is there any way make the executable use the one I just created as symlink?
 
Old 10-18-2019, 04:42 PM   #2
hoes
Member
 
Registered: Sep 2005
Distribution: debian, linux from scratch
Posts: 181

Rep: Reputation: 39
The thing it's that the runtime linker only looks in some predefined directories during program start.
You could test by setting LD_PRELOAD https://stackoverflow.com/questions/...-preload-trick
And for doing this you need top be sure that the library versions are compatible, I guess that it's the case.
Also maybe your distro has a crypto-1.0.0 in a package.
 
  


Reply

Tags
compilation, executables, library


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Stealthy, tricky to remove rootkit targets Linux systems on ARM and x86 LXer Syndicated Linux News 0 09-08-2016 06:03 AM
[SOLVED] Graphical Compilation/ IDE Compilation monika.2dec Ubuntu 4 08-22-2012 07:53 PM
X11 auto login and disable users shell - tricky business drkstr Slackware 10 08-29-2006 02:54 PM
Networking:socket ip address and port??? Tricky situations!!! Igor007 Programming 14 11-20-2005 03:26 AM
Tricky alsa and kernel 2.6 problem. raid517 Linux - Hardware 1 10-01-2003 04:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:55 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration