Home page logo
/

nmap-dev logo Nmap Development mailing list archives

libraries are out of order for static linking nmap-3.50
From: "Greg A. Woods" <woods () weird com>
Date: Sat, 28 Feb 2004 18:44:01 -0500 (EST)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You don't have your libraries in the right order for static linking:


g++ -L/lib -L/usr/lib -static -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib -Lnbase 
-Lnsock/src/  -o nmap main.o nmap.o targets.o tcpip.o nmap_error.o utils.o idle_scan.o osscan.o output.o scan_engine.o 
timing.o charpool.o services.o protocols.o nmap_rpc.o portlist.o NmapOps.o TargetGroup.o Target.o FingerPrintResults.o 
service_scan.o NmapOutputTable.o -lm  -lssl -lcrypto -lnbase -lnsock -lpcre -lpcap
nsock/src//libnsock.a(nsock_ssl.o): In function `Nsock_SSL_Init':
/build/proven/package-obj/net/nmap/work/nmap-3.50/nsock/src/nsock_ssl.c:76: undefined reference to 
`SSL_load_error_strings'
/build/proven/package-obj/net/nmap/work/nmap-3.50/nsock/src/nsock_ssl.c:77: undefined reference to `SSL_library_init'
/build/proven/package-obj/net/nmap/work/nmap-3.50/nsock/src/nsock_ssl.c:84: undefined reference to 
`SSLv23_client_method'


This is on NetBSD using the latest NetBSD pkgsrc module.  My local build
environment configures most programs to all be statically linked.

The correct library order would be more like this:

        -lnbase -lnsock -lpcre -lpcap -lssl -lcrypto -lm

(the math library should almost always come last and SSL has to come
after libnsock of course)

I think the recommended fix for this problem in projects using GNU
Autoconf is to re-order the library tests in the configure.ac source
file.  I don't have an easily usable set of autoconf tools as old as are
required for use with your code so I'll leave the actual fix to you!  ;-)

(you should always test static linking on as many platforms as you can! :-)

- -- 
                                                Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods () robohack ca>
Planix, Inc. <woods () planix com>          Secrets of the Weird <woods () weird com>

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Comment: Processed by Mailcrypt 3.5.8, an Emacs/PGP interface
Charset: noconv

iQA/AwUBQEEnpmJ7XxTCWceFEQLhlQCgr+LJxAaLEyJo85xZ2PyFGmvhAiQAoOO7
OOjMX7W3lBXQdPkISkRgJ8it
=1kEF
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
For help using this (nmap-dev) mailing list, send a blank email to 
nmap-dev-help () insecure org . List archive: http://seclists.org



  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
AlienVault