From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrey mirtchovski To: 9fans@cse.psu.edu Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: [9fans] pcc question -- main() in .a libs Date: Wed, 14 May 2003 11:27:31 -0600 Topicbox-Message-UUID: ab11093e-eacb-11e9-9e20-41e7f4b1d025 Hi, I'm having the following problem while porting ocaml using ape/psh: at one point of the build process (rather early, in fact) it builds a library called "libcamlrun.a" which contains, among other things, the definition of main(). this library is then compiled together with a list of primitives to create the first binary in the bootstrap process -- ocamlrun. the problem that I'm having is that main() appears to be stripped from the library (it's contained in main.o), resulting in unsuccessfull compilation: $ ar vu libcamlrun.a interp.o misc.o stacks.o fix_code.o startup.o main.o freelist.o major_gc.o minor_gc.o memory.o alloc.o roots.o globroots.o fail.o signals.o printexc.o backtrace.o compare.o ints.o floats.o str.o array.o io.o extern.o intern.o hash.o sys.o meta.o parsing.o gc_ctrl.o terminfo.o md5.o obj.o lexing.o callback.o debugger.o weak.o compact.o finalise.o custom.o dynlink.o unix.o $ make cc -o ocamlrun prims.o libcamlrun.a _main: undefined: main in _main cc: 8l: 8l 20157: error *** Error code 1 Stop. $ on the other hand including main.o works just fine: $ make cc -o ocamlrun prims.o libcamlrun.a main.o $ ar p libcamlrun.a main.o shows 'main' there, fyi.. andrey