3001Re: "ocaml_beginners":: Compiling Native on Windows 2000
- Mar 1, 2005On Sun, 27 Feb 2005 22:44, Richard Jones wrote:
> On Sun, Feb 27, 2005 at 01:21:21PM +1300, Tony Edgin wrote:This didn't work, but it gave me some insight into the problem. After
> > I have Visual C++ 2005 Express Edition Beta installed. It contains the
> > VC++ compiler cl.exe and the MASM assembler ml.exe. According to the
> > OCaml documentation this should be all I need, but when I execute
> > ocamlopt, I get the following linker error.
> > LINK : fatal error LNK1181: cannot open input file 'advapi32.lib'
> > Error during linking.
> The OCaml documentation is misleading - CL.EXE, and by extension
> ocamlopt, requires a bunch of libraries for linking on Windows. I
> suspect that the free version of VC++ you're using doesn't include all
> the libraries, which is why you're getting the error.
> However all might not be lost. It is possible to tell VC++ not to
> link with some of its default libraries, and (assuming the symbols in
> those libraries aren't really needed) this might work. The way to do
> this is to try passing:
> -ccopt "-link /nodefaultlib:advapi32.lib"
> on the ocamlopt linking command line (NB the quotes).
browsing the ocaml compiler source code, it appears that unless you pass the
-nopervasives argument to the compiler, the code will be linked with the
advapi32.lib library when compiling to native Windows code.
I should probably just try to get a copy of Visual C++ 2003, since according
to the ocaml docs I should be using MSVC 6 or 7 (2003), and not 8 (2005).
Thanks for your help.
- << Previous post in topic Next post in topic >>