Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] ocamlmklib on Windows
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-07-18 (16:21)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] ocamlmklib on Windows
> That don't seems to be correct. Dynamic and static libs can be linked
> with any Win32 compiler from the same set of object files. To illustrate
> this, just let me quote myself

At least with the version of VC++ I use, your example stops working
when you put the .obj files *in a static library* (which is the point
of the exercise):

  cl -c -MD lib.c
  # static linking
  cl -MD main.c lib.obj
  # LINK : warning LNK4049: locally defined symbol "_x" imported
  # but main.exe still works (the warhing can be supressed)
  # static linking via a static lib
  lib /out:staticlib.lib lib.obj
  cl -MD main.c staticlib.lib
  # main.obj : error LNK2001: unresolved external symbol __imp__x
  # main.exe : fatal error LNK1120: 1 unresolved externals

If you know how to work around this, that'd be great.  I'd suggest we
take this discussion off caml-list, though, as DLL hackery is getting
out of topic.

- Xavier Leroy

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: