Elias ringhauge
Elias ringhauge

Reputation: 307

Zlib test program won't compile due to refference error

I have been reading error LNK2019 for ZLib sample code compiling - But was unable to solve the problem regarding the linking errors. I downloaded the latest version from zlib.org and assured to inlcude the lib files to my lib folder and include files to my include folder.

However i get something like this: Tmain.obj : error LNK2019: unresolved external symbol _inflate referenced in function _inf

z_stream strm;
[...]
ret = inflateInit(&strm);

This is from the zpipe.c file, which is one of their test files, so it should compile, but every time it want to call the inflate and deflate functions, it get this linker error, (like on the other question).

I have been trying to resolve it with some of my group members, and we haven't been able to resolve it yet. We are 100% sure that the libraries are correctly placed.

Upvotes: 0

Views: 749

Answers (1)

Hans Passant
Hans Passant

Reputation: 942197

We are 100% sure that the libraries are correctly placed

Getting that wrong would produce a different error. Just putting the .lib file in a directory isn't enough, you also have to tell the linker to link the .lib file. Project + Properties, Linker, Input, Additional Dependencies.

If that doesn't help then document your question better. Post a link to the specific download you used and copy your test project to a file sharing service.

Upvotes: 2

Related Questions