title: Cannot Build C Application with GCC because of undefined reference to 'deflateEnd'
body: <p>Here is the error snippet</p>
  
  <pre><code>/home/jamesblack/Development/v2server/svr_tick.c:1309: undefined reference to `deflateEnd'
  </code></pre>
  
  <p>This happens when I run my makefile, it looks like it runs this command.</p>
  
  <pre><code>gcc -O -g -lm -lz -lcrypt -o server .obj/server.o .obj/svr_disk.o .obj/svr_tick.o .obj/svr_act.o .obj/driver.o .obj/svr_god.o .obj/svr_do.o .obj/svr_glob.o .obj/build.o .obj/use_driver.o .obj/look_driver.o .obj/svr_effect.o .obj/driver_etc.o .obj/driver_generic.o .obj/populate.o .obj/helper.o .obj/skill.o .obj/skill_driver.o .obj/talk.o .obj/area.o .obj/path.o .obj/stunrun.o .obj/cityattack.o .obj/npc_malte.o .obj/lab9.o .obj/rdtsc.o .obj/ccp_driver.o  
  </code></pre>
  
  <p>And then it spouts of alot of errors similar to that, everything i've googled mentions installing zlib and linking it with -lz, which is clearly in the make command, also im pretty sure i installed it right. apt-get install zlib1g-dev in ubuntu 11 64bit</p>
  
  <p>Any thoughts</p>
  
  <p>EDIT:</p>
  
  <p>My zlib.h located at /usr/local/zlib/include/zlib.h includes this</p>
  
  <pre><code>ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
  /*
   All dynamically allocated data structures for this stream are freed.
  This function discards any unprocessed input and does not flush any pending
  output.
  
   deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
  stream state was inconsistent, Z_DATA_ERROR if the stream was freed
  prematurely (some input or output was discarded).  In the error case, msg
  may be set but then points to a static string (which must not be
  deallocated).
  */
  </code></pre>
  
  <p>Is this what I need it to have? Also echo $LD_LIBRARY_PATH doens't return anything. Do I truly have Zlib configure properly?</p>
  
  <p>EDIT 2:</p>
  
  <pre><code>gcc -I/usr/local/zlib/include -O -g -lm -lz -lcrypt -o server .obj/server.o .obj/svr_disk.o .obj/svr_tick.o .obj/svr_act.o .obj/driver.o .obj/svr_god.o .obj/svr_do.o .obj/svr_glob.o .obj/build.o .obj/use_driver.o .obj/look_driver.o .obj/svr_effect.o .obj/driver_etc.o .obj/driver_generic.o .obj/populate.o .obj/helper.o .obj/skill.o .obj/skill_driver.o .obj/talk.o .obj/area.o .obj/path.o .obj/stunrun.o .obj/cityattack.o .obj/npc_malte.o .obj/lab9.o .obj/rdtsc.o .obj/ccp_driver.o 
  </code></pre>