LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-14-2007, 03:45 PM   #1
RaduH
LQ Newbie
 
Registered: Nov 2007
Location: Colorado, USA
Posts: 11

Rep: Reputation: Disabled
libssh2 ver. 0.18


Hi,

I am trying to build libssh2 on a Linux SUSE 10.2 on an AMD 64 Opteron and I encounter problems. I have successfully built and installed zlib and openssl but I cannot build libssh2. The error I get is:

/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -fPIC -I/usr/local/ssl/include -I/usr/local/include -L/usr/local/ssl/lib -lcrypto -L/usr/local/lib -lz -o libssh2.la -rpath /usr/local/lib -version-info 1:0:0 -no-undefined channel.lo comp.lo crypt.lo hostkey.lo kex.lo mac.lo misc.lo packet.lo publickey.lo scp.lo session.lo sftp.lo userauth.lo pem.lo transport.lo openssl.lo
gcc -shared .libs/channel.o .libs/comp.o .libs/crypt.o .libs/hostkey.o .libs/kex.o .libs/mac.o .libs/misc.o .libs/packet.o .libs/publickey.o .libs/scp.o .libs/session.o .libs/sftp.o .libs/userauth.o .libs/pem.o .libs/transport.o .libs/openssl.o -L/usr/local/ssl/lib -lcrypto -L/usr/local/lib -lz -Wl,-soname -Wl,libssh2.so.1 -o .libs/libssh2.so.1.0.0
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: /usr/local/ssl/lib/libcrypto.a(x86_64cpuid.o): relocation R_X86_64_PC32 against `OPENSSL_cpuid_setup' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libssh2.la] Error 1

Please note the color highlighting... I am asked to use -fPIC which I had already used. I built my zlib and my openssl with -fPIC too.

Any advice, anybody?

Thanks!
 
Old 11-28-2007, 04:55 PM   #2
buddha377
LQ Newbie
 
Registered: Nov 2007
Posts: 1

Rep: Reputation: 0
The Answer

Well this is a very rare error, with only about 7 entries in Google and another 2 or 3 in languages that I don't understand. Unfortunately, none of those entries have the answer. Its just radio silence. I got this error when trying to copile the tomcat library that uses the Apache Portable Runtime ( apr ). Since this was completely frustrating to me and the internet community has served me well in the past I thought I would repay the favor in the hopes that someone else suffers a few less hours in their life.

After tearing my hair out for several hours and hitting the bottle, I stumbled upon a very simple answer. You need to install openssl-devel. If you are using CentOS like moi, then simply do "yum install openssl-devel". Voila.


All the best,

Dan J
Bulldog Data Services
BulldogData - Since I can't post a url to other sites without having posted more than once you will have to just add the .com here to get to my site if you so desire to go there. Since I have actually posted an answer to a valid question here, hopefully the admins on the forum will look kindly on my little ploy to get around this limitation, since I am a busy man and don't have time to post multiple messages on internet forums all day.
 
Old 11-29-2007, 09:59 AM   #3
RaduH
LQ Newbie
 
Registered: Nov 2007
Location: Colorado, USA
Posts: 11

Original Poster
Rep: Reputation: Disabled
Hi Dan,

Well, "I solved" the problem but I cannot say I really understand what solved it. I talked to the sysadmin who has magic powers on that server and he re-installed a bunch of libraries updated libtools and next thing I knew, the darn code compiles and links just fine. It all happened on a SuSE 10.2 and apparently you gotta use it's Yast to pull in updates, not just build and install them yourself... which is a bit bizarre, to say the least (doesn't sound Linux-like...)

Cheers!
RH
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Libssh2 version RaduH Linux - Software 3 11-15-2007 12:11 PM
Upgrading Samba from ver-3.0.4 to current ver-3.0.21b delamatrix SUSE / openSUSE 3 02-20-2006 10:56 AM
Ver 2 Compiler With Ver 3. Kernel wat to do? cam34 Linux - Software 3 08-31-2003 06:15 PM
Ver. 2 @ Ver. 3 Compiler / WinModem Prob. cam34 Linux - Software 1 08-31-2003 03:55 PM
Redhat Ver 7 vs Ver 7.1 mullapudy Linux - Newbie 2 10-18-2001 01:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:08 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