The MASM Forum Archive 2004 to 2012

Project Support Forums => HLA Forum => Topic started by: gurangax on January 25, 2008, 07:29:08 AM

Title: how to link to c codes (gzip source code)
Post by: gurangax on January 25, 2008, 07:29:08 AM
I am writing a program which must use gzip compression and decompression. The problem is I am too lazy to convert the gzip c source codes into hla codes. What I did is just call the gzip.exe program using w.ShellExecute.

Is there anyway I can link my program to the gzip c source code or the *.obj so that I may run gzip directly in my program without using w.ShellExecute? Or maybe some of you guys have the gzip source code in hla are kind enough to share it with me?

The c compiler I used is GNU GCC compiler with code block IDE.


Title: Re: how to link to c codes (gzip source code)
Post by: Sevag.K on January 26, 2008, 05:29:03 AM
Quote from: gurangax on January 25, 2008, 07:29:08 AM
I am writing a program which must use gzip compression and decompression. The problem is I am too lazy to convert the gzip c source codes into hla codes. What I did is just call the gzip.exe program using w.ShellExecute.

Is there anyway I can link my program to the gzip c source code or the *.obj so that I may run gzip directly in my program without using w.ShellExecute? Or maybe some of you guys have the gzip source code in hla are kind enough to share it with me?

The c compiler I used is GNU GCC compiler with code block IDE.



Since you're using w.ShellExecute, you want gzip on Windows.  This may cause a problem.  In my experience, all the gxxx stuff has a different object format than the Windows version so you won't be able to do a straight liking.  If you do in fact have COFF object files for gzip, all you need to use the functions is to write a header file or wrapper functions (if gzip is object oriented code).

If gzip is an ELF object, you'll have more difficulties.  Perhaps there is a object file format conversion program that will help you.
Title: Re: how to link to c codes (gzip source code)
Post by: gurangax on January 27, 2008, 11:21:42 AM
thanks a lot. I need some more learning  :thumbu
Title: Re: how to link to c codes (gzip source code)
Post by: Sevag.K on January 27, 2008, 09:47:55 PM

I found this neat program by Agner Fog that might help you out here.

http://www.agner.org/optimize/objconv.zip
Title: Re: how to link to c codes (gzip source code)
Post by: gurangax on January 28, 2008, 12:15:11 PM
 :U :U :U thanksss  :U :U :U
Title: Re: how to link to c codes (gzip source code)
Post by: Evenbit on January 31, 2008, 01:42:01 AM
Do you have anything against using a DLL??

http://www.zlib.net/

Nathan.