Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 10-05-2004, 06:40 PM   #1
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)

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.
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

Old 10-05-2004, 07:21 PM   #2
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:

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


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

All times are GMT -5. The time now is 12:09 AM.

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