473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Need help linking with zlib.

kiseitai2
Hi everyone. I'm a noob to c++ (I only know basics such as interpreting the code and syntax rules, but I haven't done a major successful program yet.). I'm having trouble in the link phase. The function compress2 compiles fine but then I get the linker error undifined reference to compress2, which is declared in the header zlib.h inside my include folder. I'm using Dev-Cpp, the zlib 1.2.2 dev-pack, and the mingw32 compiler set.

Any suggestions are welcomed! Thank you,
Nov 2 '08 #1

✓ answered by oler1s

Have you linked to zlib? You compiled zlib, right? From which you should have the dll and the lib to link with. Specify that lib in the linker options.

3 4959
oler1s
671 Expert 512MB
Have you linked to zlib? You compiled zlib, right? From which you should have the dll and the lib to link with. Specify that lib in the linker options.
Nov 2 '08 #2
How dumb of me!!! Thanks man! It's a shame I usually get helped and I have only being able to lend a hand once or twice other people. :(
Nov 2 '08 #3
The following steps requires:
1) The installation of the zlib dev-pack.

For those of you with Dev-Cpp (like me) go to the project options >> Parameter,
then below the linker textbox look for the button Add Library or Object. Then, click on it and go to the folder Dev-Cpp\ lib and select libz.a. Afterwards, type #include <zlib.h> in the source file (cpp or h) and compile and use any functions. (No need to have the dll. I guess, it is because it is the static library compilation of the zlib source files)

Have fun!!!!
Nov 2 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Alan Toppen | last post by:
I was unable to use the ZipFile class in the zipfile module in Python2.4. I got an error that zlib could not be found. Comparing my Python 2.2 installation I noticed Python 2.4 was missing a...
1
by: Andreas Lobinger | last post by:
Aloha, is a pure _python_ implementation of the zlib available? I have broken zlib streams and need to patch the deocder to get them back. Wishing a happy day LOBI
1
by: Dennis Powell | last post by:
Does anyone have a successful implementaion of the zlib.dll in VB. Net they can show me. I'm writting a class encaplsulating zlib functionality and I keep getting a System.NullReferenceException...
0
by: Usman | last post by:
Hi I've a COM compiled in visual studio 6 that is internally using zlib library (an opensource library for compression). I've no problem compiling that code. But when I moved to visual...
4
by: shamzz | last post by:
Hi, I've compiled (configure/make/make install) Python 2.4.4 from source on Suse Linux Enterprise Server 9 (x64). I need Python to be compiled with Zlib so that I can compile and use Zope. ...
3
by: Milos Prudek | last post by:
I need to install my own Python. I compiled Python 2.4.4 from sources. zlib did not compile - it's not in the lib-dynload directory. I did not have this problem with any of my earlier Python...
2
by: Bint | last post by:
Hi, I asked a question yesterday but no one answered, I will try again. Anyone use stream_filter_append, specifically to decompress zlib-compressed data? I'm trying to use it on a section of data...
5
by: Chuck Anderson | last post by:
I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC (Windows XP). One of the scripts that I run daily needs to access a secure URL (https://..............). When I am running Php4,...
4
by: MZ | last post by:
Hello! I`ve tried to instal zlib library to use zip functions to pack files into zip archive. I don`t know how I have to configure zlib to make it work. I have built up php.ini file and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.