[Snort-devel] zlib and compiling with -static

Chris Green cmg at ...81...
Tue May 8 13:18:05 EDT 2001

export AM_CFLAGS="-static"

There seems to be a problem when compiling with -static and mysql.  It
has to do with the lib ordering for mysql.

if -lz is before -lmysqlclient, it fails when statically linked.

I don't understand ordering w/ AC_CHECK_LIB so I can fix this and
manually changing  to     LIBS="${LIBS} -lmysqlclient -lz" seems wrong
as well.

gcc -static -g -O2 -Wall -L/usr/lib/mysql -L/usr/lib -L/usr/lib
-L/usr/lib -o snort snort.o log.o decode.o mstring.o rules.o
plugbase.o sp_pattern_match.o sp_tcp_flag_check.o sp_icmp_type_check.o
sp_icmp_code_check.o sp_ttl_check.o sp_ip_id_check.o
sp_tcp_ack_check.o sp_tcp_seq_check.o sp_dsize_check.o
spp_http_decode.o spp_minfrag.o spp_portscan.o sp_ipoption_check.o
sp_rpc_check.o sp_icmp_id_check.o sp_icmp_seq_check.o sp_respond.o
spo_alert_syslog.o spo_log_tcpdump.o spo_database.o sp_session.o
spp_defrag.o parser.o spo_alert_fast.o spo_alert_full.o
spo_alert_smb.o spo_alert_unixsock.o sp_react.o spo_xml.o
sp_ip_tos_check.o spp_tcp_stream.o snprintf.o checksum.o
spp_tcp_stream2.o sp_reference.o sp_ip_fragbits.o spp_anomsensor.o
tag.o spp_unidecode.o codes.o strlcpyu.o strlcatu.o debug.o
sp_tcp_win_check.o spp_rpc_decode.o spp_bo.o spp_telnet_negotiation.o
spo_csv.o sp_ip_same_check.o sp_priority.o sp_ip_proto.o -lz -lpcap
-lm -lnsl -lmysqlclient -lodbc -lpq -lssl -lcrypto
/usr/lib/mysql/libmysqlclient.a(my_compress.o): In function `my_compress_alloc':
my_compress.o(.text+0xbb): undefined reference to `compress'
/usr/lib/mysql/libmysqlclient.a(my_compress.o): In function `my_uncompress':
my_compress.o(.text+0x12a): undefined reference to `uncompress'
collect2: ld returned 1 exit status
make: *** [snort] Error 1
Chris Green <cmg at ...81...>
Laugh and the world laughs with you, snore and you sleep alone.

More information about the Snort-devel mailing list