Mail Archives: djgpp/1998/02/11/04:46:28
>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 !
You can write some utility converting binary files to ordinary C files
containing only a large initialized array, something like this:
output to "datafile.c" the string "unsigned char program_data[] = {"
for every file
for every byte read from the file
output to "datafile.c" the byte as a string ( sprintf(str, "%d,",
byte); )
output to "datafile.c" the string"0 };"
then you can compile your datafile.c into a .o and then your program can
access the data using program_data as any other array.
(of course you don't have to take this literal, but can give you a hint :-)
ciao
Giacomo
- Raw text -