[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: where to put object file



[skaller]
> That isn't really possible: the file contains main(), and there could
> be more than one such file which do different things (in fact there
> are, but only one is 'standard' at the moment).

Sounds like a situation similar to 'liby', a helper library for yacc.
It contains a main function which turns a yacc parser into a
stdin/stdout filter that uses the parser.  Most people don't use it,
but use yacc parsers in more complex programs.

liby is presented as a static library in /usr/lib/.  If you had your
own main function but still said -ly on the command line, the linker
would just ignore the main function in /usr/lib/liby.a.  (In practice
you don't say -ly unless you *do* want to use its main function, since
that's all it contains, but anyway.)

I'd suggest the same for your object file - wrap it in a simple
/usr/lib/libflx_run.a file and have done.  Much more convenient for use
with linkers, and the linker will still ignore the library's main
function if you've got another main function you're linking in.

Peter

Attachment: signature.asc
Description: Digital signature


Reply to: