This is what I'm executing: ocamlopt -output-obj -o ocamllibrary.o library.ml cl /c my_plugin.c /I"C:\\wodi32\\opt\\wodi32\\lib\\ocaml\\std-lib" cl /c ocaml_stub.c /I"C:\\wodi32\\opt\\wodi32\\lib\\ocaml\\std-lib" flexlink -chain msvc -exe -o my_plugin.exe my_plugin.obj ocaml_stub.obj ocamllibrary.o plug.lib -lasmrun -lgcc -L "C:\wodi32\lib\gcc\i686-w64-mingw32\4.8.2" Leonardo On Fri, May 9, 2014 at 10:20 PM, Adrien Nader wrote: > On Fri, May 09, 2014, Leonardo Laguna wrote: > > I have given up on compiling the msvc port. I don't know why I'm getting > > errors when the '.exe' is not there. > > > > I will try to explain better what I want to do. > > > > I have the following files: > > > > - plug.lib (provided by the software vendor, closed source, compiled with > > VC++), in OSX I have plug.a > > - my_main.c (the code for the plugin) > > - ocaml_stub.c (this code calls 'caml_startup()') > > - ocaml_code.ml > > > > in OSX I compile my_main.c, ocaml_stub.c and ocaml_code.ml to obtain > '.o' > > files. Then I link the .o files with plug.a and libasmrun.a. This works > > fine. > > > > In windows I have wodi32, visual studio 2008 and Flexdll. I tried the > > following. > > - Using cl compile, ocaml_stub.c, my_main.c to obtain '.obj' files > > - Using ocamlopt, compile ocaml_code.ml to obtain a '.o' file > > - Using flexlink to link the .obj, .o, libasmrun.a, plug.lib, libgcc.a > and > > libc.a > > > > This gives me an error: > > > > ** Cannot resolve symbols for libasmrun.a(floats.o): > > ___strtod > > > > I have tried to create my own strtod function and link it does not pick > it. > > > > Anybody knows how can I link my program. > > Can you provide the commands? In particular the flexlink one? > > Also you probably shouldn't call flexlink directly; using ocamlc should > do it. > > -- > Adrien Nader >