From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA30055; Thu, 10 Jun 2004 16:07:13 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA30355 for ; Thu, 10 Jun 2004 16:07:12 +0200 (MET DST) From: peter.ilberg@ni.com Received: from mailserver01-us.natinst.com (mailserver01-us.natinst.com [130.164.14.247]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i5AE7BEV013951 for ; Thu, 10 Jun 2004 16:07:12 +0200 Received: from postoffice2.natinst.com ([130.164.46.199]) by mailserver01-us.natinst.com (Lotus Domino Release 6.5.1) with ESMTP id 2004061009071054-23275 ; Thu, 10 Jun 2004 09:07:10 -0500 To: caml-list@inria.fr Subject: [Caml-list] Linking native ocaml object files into C app on Windows MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.0.2CF2 July 23, 2003 Message-ID: Date: Thu, 10 Jun 2004 09:07:10 -0500 X-MIMETrack: Serialize by Router on PostOffice2/AUS/M/NIC(Release 6.5.1|January 21, 2004) at 06/10/2004 09:07:10 AM, Serialize complete at 06/10/2004 09:07:10 AM, Itemize by SMTP Server on MailServer01-US/AUS/H/NIC(Release 6.5.1|January 21, 2004) at 06/10/2004 09:07:10 AM, Serialize by Router on MailServer01-US/AUS/H/NIC(Release 6.5.1|January 21, 2004) at 06/10/2004 09:07:12 AM, Serialize complete at 06/10/2004 09:07:12 AM Content-Type: text/plain; charset="US-ASCII" X-Miltered: at nez-perce with ID 40C86B0F.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; nologo:01 ocamlopt:01 -output-obj:01 nologo:01 libpath:01 progra:01 libasmrun:01 pervasives:01 pervasives:01 libasmrun:01 frametable:01 ocaml:01 ocaml:01 caml:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello everyone! I'm trying to add some ocaml code (a simple lexer/parser) to an existing C application and I'm having problems linking the whole thing on Windows. Needless to say, everything works fine under Unix (Mac OS X). I'm using the MSVC version of ocaml. Here's are the commands that I use to build the whole thing: cl /c /nologo /MT /I "C:\Program Files\Objective Caml\lib" main.c ocamllex lexer.mll ocamlopt -c -output-obj lexer.ml -o lexer.obj cl -o test main.obj lexer.obj /link /nologo /libpath:"c:\progra~1\object~1\lib" libasmrun.lib And here are the link errors that result from the last command: lexer.obj : error LNK2001: unresolved external symbol _Lexing__engine_117 lexer.obj : error LNK2001: unresolved external symbol _Lexing__from_function_140 lexer.obj : error LNK2001: unresolved external symbol _Lexing__lexeme_155 lexer.obj : error LNK2001: unresolved external symbol _Pervasives__close_out_232 lexer.obj : error LNK2001: unresolved external symbol _Pervasives__open_out_202 lexer.obj : error LNK2001: unresolved external symbol _Pervasives__output_string_214 lexer.obj : error LNK2001: unresolved external symbol _caml_curry2 libasmrun.lib(startup.obj) : error LNK2001: unresolved external symbol _caml_code_segments libasmrun.lib(startup.obj) : error LNK2001: unresolved external symbol _caml_data_segments libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _Failure libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _Invalid_argument libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _Out_of_memory libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _Stack_overflow libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _Sys_error libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _End_of_file libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _Division_by_zero libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _Not_found libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _Sys_blocked_io libasmrun.lib(i386nt.obj) : error LNK2001: unresolved external symbol _caml_apply2 libasmrun.lib(i386nt.obj) : error LNK2001: unresolved external symbol _caml_apply3 libasmrun.lib(i386nt.obj) : error LNK2001: unresolved external symbol _caml_program libasmrun.lib(roots.obj) : error LNK2001: unresolved external symbol _caml_globals libasmrun.lib(roots.obj) : error LNK2001: unresolved external symbol _caml_frametable test.exe : fatal error LNK1120: 23 unresolved externals I'm sure I'm missing something obvious, but I can't figure it out. Thanks in advance, Peter ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners