Mail Archives: djgpp/1997/04/21/22:54:37
Ali Bharmal wrote:
> // These are here to reduce personal.exe size, they are just dummy funcs
> static void __crt0_load_environment_file(char *_app_name);
> static void __crt0_setup_arguments(void);
> static char **__crt0_glob_function(char *_arg);
There's a problem with this that's more than just declaring the
functions static. By leaving out the function bodies, and just
terminating the function declarations with semicolons, you are
*declaring* the functions, not *defining* them. The compiler just goes
ahead and says, "Oh, now I know what these functions look like," and
promptly forgets about them. If you had included <crt0.h> you'd have
gotten warnings about multiple declarations of those functions.
Also, you MUST have your dummy __crt0_glob_function() return NULL, or
the startup code will crash messily. I know this from experience. ;)
Try the following instead:
#include <crt0.h>
void __crt0_load_environment_file(char *_app_name) {}
void __crt0_setup_arguments(void) {}
char **__crt0_glob_function(char *_arg) {return NULL;}
hth!
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| Proud owner of what might one | http://www.cs.com/fighteer |
| day be a spectacular MUD... | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------
- Raw text -