Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

gzopen not recognized on compile

Posted on 2009-04-29
9
Medium Priority
?
750 Views
Last Modified: 2012-05-06
I am trying to compile and when I run ./configure I get

checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for POSIXized ISC... no
checking how to run the C preprocessor... (cached) gcc -E
checking for ANSI C header files... (cached) yes
checking for ranlib... (cached) ranlib
checking for gdImageCreateFromPng in -lgd... (cached) no
checking for gdImageStringTTF in -lgd... (cached) no
checking for png_init_io in -lpng... (cached) no
checking for gzopen in -lz... (cached) no
checking for ANSI C header files... (cached) yes
checking for fcntl.h... (cached) yes

zlib1g, zlib1g-dbg, and zlib1g-dev are installed on ubuntu and zlib.h is in /usr/include/

any suggestions on how to get gzopen to work?

thanks
0
Comment
Question by:aijohn
  • 4
  • 3
  • 2
9 Comments
 
LVL 40

Assisted Solution

by:evilrix
evilrix earned 600 total points
ID: 24262335
I wrote this...

#include <zlib.h>

int main()
{
        gzFile f = gzopen("test.gz", "w");
        gzclose(f);
}

Compiled it like this...

g++ -lz x.cpp

And it compiled and linked. Can you just try doing the same?
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24262350
What does this show?

nm /usr/lib/libz.a | grep gzopen
0
 

Author Comment

by:aijohn
ID: 24262438
000019a0 T gzopen
00001980 T gzopen64
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 40

Expert Comment

by:evilrix
ID: 24262466
Then the lib exists and has the symbols for gzopen in it... did you try linking against it like I suggested... just to make sure you can link to it? If that works you can always try looking at what the script is doing to check it exists.
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24262472
Then I think the configure.pl script is not finding the correct library. Try compiling evilrix' program standalone. The problem might not be your system or your compiler, but your configure script.
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24262481
@evilrix: oops I see you have it in hand
0
 
LVL 40

Expert Comment

by:evilrix
ID: 24262490
>> @evilrix: oops I see you have it in hand
No worries... collaboration is good for the soul (and the asker) :)
0
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 1400 total points
ID: 24262640
I think the problem is you may have run configure prior to installing the library, and now configure script is checking its cache file only

checking for gzopen in -lz... (cached) no

Note, (cached), so I think your configure script is not even checking the library realtime, so you should clear it and run again. I think its probably named config.cache
0
 

Author Comment

by:aijohn
ID: 24264261
Wonderful!  Cleared config.cache and got a good install. This is old, old code and still hs problems but will handle that with some more questions.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question