Problem with ld again

owning

Registered
Hello all,
I have a makefile which looks like :

CC=/usr/bin/g++
CPPFLAGS=-c -g -I/usr/local/Coral/include -I.
LDFLAGS=-L/usr/local/Coral/lib -lcoral -lpcap -lhashtab -lstdc++
OBJECTS=coral_test.o
TARGET=coral

$(TARGET): $(OBJECTS)
$(CC) -g -o $(TARGET) $(OBJECTS) $(LDFLAGS)

coral_test.o: coral_test.c Makefile
$(CC) $(CPPFLAGS) coral_test.c

clean:
rm -rf $(OBJECTS) $(TARGET)

but when i do a make i get an error as :
Trinity:~/coral-3.7.5-public/custom hetawal$ make
/usr/bin/g++ -c -g -I/usr/local/Coral/include -I. coral_test.c
/usr/bin/g++ -g -o coral coral_test.o -L/usr/local/Coral/lib -lcoral -lpcap -lhashtab -lstdc++
/usr/bin/ld: Undefined symbols:
_gzerror
_gzclose
_gzdopen
_gzflush
_gzseek
_gzwrite
_gzread
_gzopen
collect2: ld returned 1 exit status
make: *** [coral] Error 1


What should i do to solve it .


Thanks
 
Add "-lz" to your LDFLAGS:

Code:
LDFLAGS=-L/usr/local/Coral/lib -lcoral -lpcap -lhashtab -lz -lstdc++
 
Back
Top