开发者

Firstobjects easyzlib does not work on RedHat 4 Linux

I have开发者_开发百科 tried hard to get this file working on Linux, but I am unable. What is the issue I am unable to understand? It is not writing the proper header.

If any one has any idea, please let me know.


Easy zlib is available from FirstObject and comes as a simple zip file containing a C source file (about 330 KiB) and a header file (just over 3 KiB) which extract into the current directory. There is no configuration file, makefile or anything.

On MacOS X (10.6.6) with GCC (4.5.2), it compiles to an object file (about 86 KiB) trivially:

gcc -c easyzlib.c

How you package it from there seems to be up to you.

  • You could simply use the source code in your project directory, and compile it as just another object file that is part of your system.

  • Alternatively, you could compile it into a shared object and install it in an appropriate location (/usr/local/lib, perhaps) and place the header in the appropriate place (/usr/local/include). Then you'd need to make sure the compiler looks in those places for the files. At a pinch (though I don't recommend it) you could install them into /usr/lib and /usr/include, in which case there'd be no flags to add because the compiler looks there anyway. If you do 32-bit and 64-bit compilations, or if you want shared and static libraries, or other such complications, then you need to know a lot about your build system.

Unless you have a compelling reason to do otherwise, I suggest you treat it as local source to your project. In the short term, that is least painful. If you use it in many projects (remembering that computers count zero, one, many), then look into installing it once.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜