getting compilation error - undefined reference to `gzopen'

3,057 views
Skip to first unread message

utkal keshari Pradhan

unread,
Jul 14, 2014, 11:12:26 AM7/14/14
to fix8-de...@googlegroups.com
Hi,

I am building a application using fix8.
I downloaded the latest fix8 i.e. fix8-1.2.0 and did followed the steps provided in README.
After that i am trying to build the test code provided.
While compiling it I am getting below undefined reference to `gzopen' error.

Please suggest me what i am doing wrong.

Compilation out put:

[ test]$  g++ -I/home/utkal/dev/code/fix8-1.2.0/include -I/home/utkal/dev/code/fix8-1.2.0/include/fix8 -I/home/utkal/dev/code/fix8-1.2.0/usr/ -L/home/utkal/dev/code/fix8-1.2.0/usr/local/lib/ -lPocoFoundation -lPocoNet -lPocoUtil -lPocoXML -lfix8 -pthread -std=c++11 -g  myfix.cpp Myfix_types.cpp Myfix_traits.cpp Myfix_classes.cpp  -o HFTEST
/home/utkal/dev/code/fix8-1.2.0/usr/local/lib//libfix8.so: undefined reference to `gzopen'
/home/utkal/dev/code/fix8-1.2.0/usr/local/lib//libfix8.so: undefined reference to `gzread'
/home/utkal/dev/code/fix8-1.2.0/usr/local/lib//libfix8.so: undefined reference to `gzclose'
/home/utkal/dev/code/fix8-1.2.0/usr/local/lib//libfix8.so: undefined reference to `gzwrite'
collect2: error: ld returned 1 exit status

Thank you in advance.

Dakka

unread,
Jul 14, 2014, 5:21:15 PM7/14/14
to fix8-de...@googlegroups.com
You need zlib. Try the following - you may have to check these install target names as these are from memory....
For RHEL/Centos

yum install zlib-devel libz.so.1 

For ubuntu/dev

apt-get install zlibc zlib1g zlib1g-dev

/dakka

Dakka

unread,
Jul 14, 2014, 6:26:31 PM7/14/14
to fix8-de...@googlegroups.com
Also make sure libz.so.1 is on your LD_LIBRARY_PATH
Reply all
Reply to author
Forward
0 new messages