Re: A project without a library or executable issues.
Re: A project without a library or executable issues.
- Subject: Re: A project without a library or executable issues.
- From: Rush Manbert <email@hidden>
- Date: Wed, 14 Dec 2005 11:57:24 -0800
D. Walsh wrote:
I'm trying to generate a project that does not generate libraries or
executables but data files.
I've gone through the docs and every target they speak of is either an
executable or a library but this project is for data files only.
What's the trick??
I can compile the source files from the CL however there are always 244
leading bytes of data (see dump below).
The actual files have 200-1000 matrix entires that are 10 bytes per row
and 16+ rows so using a hex-editor to generate the 30-40 files hurts.
Here is my test compile session with a reduced file with 1 row of 10
bytes so the file should be 10 bytes in length.
test.c
___________________________
/*
this is all the data
the file should be 10 bytes in length
*/
char testDATA[] = {
/* Entry 000 */
1,2,3,4,5,6,7,8,9,10,
};
___________________________
(I'd be content in using a Makefile if I could figure out how to not
generate the leading data)
compiled with:
gcc -pipe -static -c -o test.out test.c
___________________________
here's the resulting file content, there are always 244 leading bytes
of data that should not be included in the file contents as well as
some trailing.
<snip>
I don't see any other responses, so I'll take a swipe at this one...
If I understand correctly, you have a "C" source file that contains a
data array definition. You are trying to compile this and what you want
from it is a binary file that contains the data values as bytes?
You can't get there this way. When you run the source through the
compiler, it generates an object file that contains code and data
segments. That's what the "extra" leading and trailing bytes are.
If you find your test.o file and execute "otool -d" on it, you can get a
hex dump of the data segment contents, which you could then clean up
with an editor (it has offsets in the left column, plus trailing zeros
if the number of bytes in your array isn't a multiple of 4), but I
suspect that's not what you want.
How about turning this into a program that walks through the testDATA
array and writes all of the byte values out to a binary file?
- Rush
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden