Thread overview
Problem using libs...
Aug 17, 2011
Eight
Aug 17, 2011
Eight
Aug 20, 2011
Walter Bright
August 17, 2011
Hi there,

I'm hoping some can help me here.

I'm trying to use DMC to compile a raw 16-bit binary (.com) for use in a
bootloader. To cut a very long story short, everything is coolio until I try
and use a function from the standard libraries. At which point I am greeted
with the message:
\lib\SDS.lib(c)
Error 42: Symbol Undefined _main

Of course, if I define it then the exe2bin conversion fails.

Is it not possible to use the standard libraries from .com objects? Or if it is, can anyone give me a clue of how to go forward from this.

Many thanks.

8
August 17, 2011
Ack, forgot to add.

"#include <time.h>" or "#include <ctime>" works fine.

"time_t seconds;" appears to work fine.

But "seconds = time(NULL);" causes the error to appear.

I've tried this with a few different standard funcs, and the same behaviour occurs. When a function is called, _main seems to become an issue.

Cheers.
August 20, 2011
Eight wrote:
> I'm trying to use DMC to compile a raw 16-bit binary (.com) for use in a
> bootloader. To cut a very long story short, everything is coolio until I try
> and use a function from the standard libraries. At which point I am greeted
> with the message:
> \lib\SDS.lib(c)
> Error 42: Symbol Undefined _main
> 
> Of course, if I define it then the exe2bin conversion fails.
> 
> Is it not possible to use the standard libraries from .com objects? Or if it
> is, can anyone give me a clue of how to go forward from this.

first off, you do need a main() function. Second, conversion to .com fails if your code+data exceed 64K in size. So, I'd try starting with a trivial program first.