Mail Archives: djgpp/1998/03/28/13:16:40
Nils Emil P. Larsen wrote:
>
> Can I split my EXE-file into a EXE-file and a OBJ-file?
> It may be possible to move data from the EXE-file to a OBJ-file. I don't
> care about the size of the OBJ, but I don't like that EXE-files are
> greather than 50 KB.
What you may be asking is if DJGPP supports shared libraries or DLLs.
The general answer is no; however, there are several projects in the
works right now to provide the equivalent of DLLs. As it stands, there
are no plans to allow DJGPP to support shared libraries, which are
fairly useless anyway in a single-tasking environment.
Your complaint seems to be more related to the final size of DJGPP
executables. The DJGPP Frequently Asked Questions list discusses this
topic in detail in chapter 8.15; basically, what you get for all those
extra bytes is the code that loads DPMI, installs interrupt handlers,
globs the command line, reads the environment, and much more. There's a
lot of overhead involved in running a protected mode app!
Even if you could break out the library code and put it in a separate
object file or DLL-equivalent, you'd still be stuck with all the startup
code which makes up 40-50K of that executable. There are, however, ways
to reduce the size of the executable if you don't need some of the
startup code's functionality; they are discussed in detail in chapter
8.15 of the FAQ. Using them, a basic "hello, world" program can be
reduced to as little as 20K or so.
If you want small programs, you should use Turbo C. DJGPP is for
power. :-)
--
---------------------------------------------------------------------
| John M. Aldrich | "Animals can be driven crazy by pla- |
| aka Fighteer I | cing too many in too small a pen. |
| mailto:fighteer AT cs DOT com | Homo sapiens is the only animal that |
| http://www.cs.com/fighteer | voluntarily does this to himself." |
---------------------------------------------------------------------
- Raw text -