Hello, i'm trying to solve the following situation: building a library which contains some functions and also main(). The goal is, to use this as a framework and link it with a user supplied module which only contains some callback functions. Building up the library is not the problem. Listing it with LIB51 shows: DOS LIBRARY MANAGER LIB51 V4.01 COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 1997 LIBRARY: MYLIB.LIB >LIB_FUNC >>F_MY_LIB_FUNCTION >LIB_MAIN >>MAIN (>'s added because the forum doesn't support blanks at beginning of line :-) So main() seems to be put in the library as i want it. The problem is linking it with the user supplied module. The linker does not find a root segment. So i tried to add main() as a root segment by specifying overlay(* ! MAIN) as a linker option. But the linker never finds main() at all. Here's my complete linker call: L51 user.obj, mylib.lib to mytest.abs ramsize(256) XD(0000h) overlay(* ! MAIN) It results in: *** WARNING 11: CANNOT FIND SEGMENT OR FUNCTION NAME NAME: MAIN *** WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?F_THE_CALLBACK?USER *** WARNING 10: CANNOT DETERMINE ROOT SEGMENT (where F_THE_CALLBACK is a user supplied function called from within main() ) So, even the overlay manager seems not to "see" main. Where's my mistake? Is main() processed different from other functions? Is it impossible to put main() into a library? Thanks in advance for your help. FRANK
Hi Erik, Let's give this a try. If this doesn't work, I'll email it to you and anyone else that wants it. ftp.crown.com/.../codewright.pdf -Walt
it works well, I'll have a look. Thanx, Erik