LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-05-2004, 05:40 PM   #1
Avatar33
Member
 
Registered: May 2003
Location: South Africa
Distribution: Ubuntu
Posts: 75

Rep: Reputation: 15
Linking problems


Hi all.

I'm trying to compile chntpw on redhat 9.0

I'm a little rusty when it comes to the linking part.
The install file says that openssl is required and I have this (rpm -q openssl-devel)

Quote:
If make goes well, you should have a single binary
called 'chntpw', dynamically linked with the clib,
statically with the ssl library.
All is not going well as I can't find the correct command in the gcc manual to link with this file. I have tried the following commands (and others) with no success: The second line in each case is the error message. I have confirmed that the library "libssl.a" is indeed in that directory.
Code:
gcc ntreg.o chntpw.o  -l /usr/lib/libssl.a -o chntpw
/usr/bin/ld: cannot find -l/usr/lib/libssl.a

gcc ntreg.o chntpw.o -L/usr/lib -l libssl -o chntpw
/usr/bin/ld: cannot find -llibssl
Could someone please tell me what is the difference between static and dynamic linking and/or point me towards some resources that I can read.
And what command should I use to link these files

Thanks
 
Old 10-05-2004, 06:21 PM   #2
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
Try just "-lssl" instead of "-l libssl". The lib will generally be prepended automatically. Also, put the options in front of the filenames, so the whole command looks like this:

Code:
gcc -L/usr/lib -lssl ntreg.o chntpw.o -o chntpw
 
  


Reply


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
linking problems wmoti Programming 11 09-24-2005 11:30 PM
Problems linking linux and Win 2K Scroto Linux - Networking 5 02-24-2005 09:23 AM
Linking Problems doubleds Linux - Software 4 12-03-2004 09:49 PM
Problems statically linking with libsdl jakobf Programming 3 08-27-2004 12:20 AM
math.h linking problems spuzzzzzzz Programming 3 02-21-2004 05:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:27 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration