Date: Wed, 11 Feb 1998 18:40:31 -0800 (PST) Message-Id: <199802120240.SAA17111@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: pneyz , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: HELP - How to link Binary Files in a Data File Precedence: bulk At 09:16 2/11/1998 -0800, pneyz wrote: >> Could someone please tell me how can I link all my binary data files in a >> single ONE using DJGPP ?!?! I would like a more simple and atractive >> solution instead of the old "copy /b ...+...+.." and modify the offsets in >> the data reader !!! Instead, if someone can tell me how to link all those in >> the .EXE file, would be fine too ! > >Get a binary to C converter. I've written one and it's easy to do what >you're saying: > > bin2c binary.dat arrayname >> bin-data.c > >and just repeat for each binary file. If you want a copy of my program, >email me and I'll send it to you. Some additional comments: * You may already have a program like this. DJGPP is supposed to include a `bin2h' utility that does that but it was omitted from the binary distribution. If you have built the library source it's installed, or if you extract the bin2h file and compile by hand. * If you have a very large data file, this won't work. GCC has a misfeature that makes it use extreme amounts of memory and stack when compiling large initialized arrays, and it can easily run out and crash. Converting your datafile to assembly does work. I think somebody wrote one, or a little look at `as' docs and GCC output can show how it works. Nate Eldredge eldredge AT ap DOT net