Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.


when I'm trying to install it I get this:

cc -O2 -pipe -fno-strict-aliasing  -c main.c
cc -O2 -pipe -fno-strict-aliasing  -c blowfish.c
cc -O2 -pipe -fno-strict-aliasing  -c rwfile.c
cc -O2 -pipe -fno-strict-aliasing  -c keys.c
cc -O2 -pipe -fno-strict-aliasing  -c wrapbf.c
cc -O2 -pipe -fno-strict-aliasing  -c endian.c
cc -O2 -pipe -fno-strict-aliasing  -c wrapzl.c
cc -O2 -pipe -fno-strict-aliasing  -o bcrypt main.o blowfish.o rwfile.o keys.o wrapbf.o endian.o wrapzl.o
wrapzl.o(.text+0x55): In function `douncompress':
: undefined reference to `uncompress'
wrapzl.o(.text+0x149): In function `docompress':
: undefined reference to `compress'
*** Error code 1
1 error
*** Error code 1

In makefile there is:

LDFLAGS+=       -lz

How to trace this error and solve problem?

@arved, that is Makefile:

DEFAULTS = Makefile includes.h blowfish.h functions.h config.h
CC?= gcc
CFLAGS?= -O2 -Wall
OBJS = main.o blowfish.o rwfile.o keys.o wrapbf.o endian.o wrapzl.o
LDFLAGS?= -L/usr/local/lib -lz
PREFIX?= /usr/local
share|improve this question
Side note: You may want to use OpenSSL's bf encryption instead of bcrypt as it's a much more widely supported format. – Chris S Nov 21 '11 at 16:53

1 Answer 1

up vote 1 down vote accepted

Works for me.

Can you post /usr/ports/security/bcrypt/work/bcrypt-1.1/Makefile ?

There should be a line like: LDFLAGS?= -L/usr/local/lib -lz in it.

If you don't have it, it is a hint that your "sed" might be broken.

share|improve this answer
Makefile seems ok (see edit), anyway I used pkg_add and that did it. – Sergey Nov 22 '11 at 7:56
if someone wants to debug this further, next step would be to test if your libz has the required functions, or to add more debug output by running "make -dl" – arved Nov 25 '11 at 5:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.