Loading ...
Sorry, an error occurred while loading the content.

Re: "ocaml_beginners"::[] Compiling Native on Windows 2000

Expand Messages
  • Tony Edgin
    ... This didn t work, but it gave me some insight into the problem. After browsing the ocaml compiler source code, it appears that unless you pass the
    Message 1 of 6 , Mar 1, 2005
    • 0 Attachment
      On Sun, 27 Feb 2005 22:44, Richard Jones wrote:
      > On Sun, Feb 27, 2005 at 01:21:21PM +1300, Tony Edgin wrote:
      > > 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).

      This didn't work, but it gave me some insight into the problem. After
      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.

      Tony
    • Richard Jones
      ... MSVC 6 definitely worked for us. Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets
      Message 2 of 6 , Mar 1, 2005
      • 0 Attachment
        On Tue, Mar 01, 2005 at 09:37:57PM +1300, Tony Edgin wrote:
        > 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).

        MSVC 6 definitely worked for us.

        Rich.

        --
        Richard Jones, CTO Merjis Ltd.
        Merjis - web marketing and technology - http://merjis.com
        Team Notepad - intranets and extranets for business - http://team-notepad.com
      • Andrei Formiga
        You can get advapi32.lib from the MS Core SDK. Check out this message from the archives: http://caml.inria.fr/archives/200404/msg00823.html I remember I found
        Message 3 of 6 , Mar 1, 2005
        • 0 Attachment
          You can get advapi32.lib from the MS Core SDK. Check out this
          message from the archives:
          http://caml.inria.fr/archives/200404/msg00823.html

          I remember I found the two required lib files (advapi32 and
          uuid.lib) bundled with an old copy of masm I had. It worked.

          --
          []s, Andrei Formiga


          On Tue, 1 Mar 2005 09:41:58 +0000, Richard Jones <rich@...> wrote:
          >
          > On Tue, Mar 01, 2005 at 09:37:57PM +1300, Tony Edgin wrote:
          > > 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).
          >
          > MSVC 6 definitely worked for us.
          >
          > Rich.
          >
          > --
          > Richard Jones, CTO Merjis Ltd.
          > Merjis - web marketing and technology - http://merjis.com
          > Team Notepad - intranets and extranets for business - http://team-notepad.com
        • Tony Edgin
          ... Thanks! I got it to work following the theme of your suggestion. I downloaded MASM32, which included the advapi32.lib. Next, I did something evil; I
          Message 4 of 6 , Mar 4, 2005
          • 0 Attachment
            On Wed, 02 Mar 2005 03:53, Andrei Formiga wrote:
            > You can get advapi32.lib from the MS Core SDK. Check out this
            > message from the archives:
            > http://caml.inria.fr/archives/200404/msg00823.html
            >
            > I remember I found the two required lib files (advapi32 and
            > uuid.lib) bundled with an old copy of masm I had. It worked.

            Thanks!

            I got it to work following the theme of your suggestion. I downloaded MASM32,
            which included the advapi32.lib. Next, I did something evil; I copied
            advapi32.lib into the MSVC 8 library directory. Now ocamlopt compiles my
            program.

            cheers.

            Tony
          Your message has been successfully submitted and would be delivered to recipients shortly.