- #1
- 14,983
- 28
I want to write a library that has a large object in it.
Specifically, it's a 4 megabyte array, but I'm curious about general objects too.
I want to create a library (on a UNIX machine) that includes this object. I know of three ways I don't like so far:
(1) Construct the object at runtime
It's time consuming, and I'd not like to have to wait every time I run my programs.
(2) Load the object from a separate file at runtime
I don't like having zillions of files lying around -- besides, it seems silly... isn't the point of an archive to hold these things?
(3) Generate a (huge) header file that gets included when building the library.
gcc chokes on it, and it takes forever to compile, though I do get what I want at the end.
Any suggestions?
Specifically, it's a 4 megabyte array, but I'm curious about general objects too.
I want to create a library (on a UNIX machine) that includes this object. I know of three ways I don't like so far:
(1) Construct the object at runtime
It's time consuming, and I'd not like to have to wait every time I run my programs.
(2) Load the object from a separate file at runtime
I don't like having zillions of files lying around -- besides, it seems silly... isn't the point of an archive to hold these things?
(3) Generate a (huge) header file that gets included when building the library.
gcc chokes on it, and it takes forever to compile, though I do get what I want at the end.
Any suggestions?