You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 3821 Reporter: administrator Assigned to:@xavierleroy Status: closed (set by @xavierleroy on 2007-11-01T16:51:50Z) Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Dmitry Bely
Version: 3.08.4
OS: Windows XP
Submission from: munitions2.xs4all.nl (194.109.217.74)
Looks like MSVC 7.1 is more strict than MSVC 6.0 and requres /subsystem:console
linker option where it previously didn't. Worse, it looks like it cannot be
specified via #pragma comment(linker , "/subsystem:console") as before; compare
At least, adding #pragma comment(linker , "/subsystem:console") to
byterun/main.c did not help. Adding "-ccopt /link -ccopt /subsystem:console" to
each ocamlopt invocation solves the problem but is very boring. I hope you know
the better solution.
Dmitry Bely
P.S. You don't need to bought the whole MS Visual Studio .Net to reproduce the
problem; all this should apply to the Microsoft Visual C++ Toolkit 2003 that is
freely available from http://msdn.microsoft.com/visualc/vctoolkit2003/ (just the
same compiler but without IDE)
The text was updated successfully, but these errors were encountered:
Looks like the problem only appears when Ocaml is compiled against DLL C
runtime library (i.e. with /MD instead of /MT everythere in
config/Makefile). In the former case Microsoft linker probably assumes
"/subsystem:console" option by default. I don't know if you consider
impossibility to use /MD as a bug, but currently I fixed this the following
way:
Index: asmlink.ml
--- asmlink.ml (revision 14)
+++ asmlink.ml (working copy)
@@ -255,17 +255,26 @@
(Ccomp.quote_files (List.rev file_list))
| "msvc" ->
if not !Clflags.output_c_object then
Original bug ID: 3821
Reporter: administrator
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2007-11-01T16:51:50Z)
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Dmitry Bely
Version: 3.08.4
OS: Windows XP
Submission from: munitions2.xs4all.nl (194.109.217.74)
E.g.:
C:\Work\Ocaml\ocaml-3.08.4>make -f Makefile.nt opt.opt
...
make[1]: Leaving directory `/cygdrive/c/Work/Ocaml/ocaml-3.08.4/asmrun'
boot/ocamlrun ./ocamlopt -I stdlib -o ocamlc.opt utils/misc.cmx utils/tbl.cmx
utils/config.cmx utils/clflags.cmx utils/terminfo.cmx utils/ccomp.cmx
utils/warnings.cmx utils/consistbl.cmx parsing/linenum.cmx parsing/location.cmx
parsing/longident.cmx parsing/syntaxerr.cmx parsing/parser.cmx parsing/
lexer.cmx parsing/parse.cmx parsing/printast.cmx typing/ident.cmx
typing/path.cmx typing/primitive.cmx typing/types.cmx typing/btype.cmx
typing/oprint.cmx typing/subst.cmx typing/predef.cmx typing/datarepr.cmx
typing/env.cmx typing/typedtree.cmx typing/ctype.cmx typing/printtyp.cmx
typing/includeclass.cmx typing/mtype.cmx typing/includecore.cmx
typing/includemod.cmx typing/parmatch.cmx typing/typetexp.cmx typing/stypes.cmx
typing/typecore.cmx typing/typedecl.cmx typing/typeclass.cmx typing/typemod.cmx
bytecomp/lambda.cmx bytecomp/printlambda.cmx bytecomp/typeopt.cmx
bytecomp/switch.cmx bytecomp/matching.cmx bytecomp/translobj.cmx
bytecomp/translcore.cmx bytecomp/translclass.cmx bytecomp/translmod.cmx
bytecomp/simplif.cmx bytecomp/runtimedef.cmx bytecomp/meta.cmx
bytecomp/instruct.cmx bytecomp/bytegen.cmx bytecomp/printinstr.cmx
bytecomp/opcodes.cmx bytecomp/emitcode.cmx bytecomp/bytesections.cmx
bytecomp/dll.cmx bytecomp/symtable.cmx bytecomp/bytelink.cmx
bytecomp/bytelibrarian.cmx bytecomp/bytepackager.cmx driver/pparse.cmx
driver/errors.cmx driver/compile.cmx driver/main_args.cmx driver/main.cmx
asmrun/meta.obj asmrun/dynlink.obj
LINK : fatal error LNK1561: entry point must be defined
Error during linking
make: *** [ocamlc.opt] Error 2
Looks like MSVC 7.1 is more strict than MSVC 6.0 and requres /subsystem:console
linker option where it previously didn't. Worse, it looks like it cannot be
specified via #pragma comment(linker , "/subsystem:console") as before; compare
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_predir_comment.asp
(MSVC 6.0)
with
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_PREDIR_comment.asp
(MSVC 7.1 a.k.a. MS Visual Studio .Net 2003)
At least, adding #pragma comment(linker , "/subsystem:console") to
byterun/main.c did not help. Adding "-ccopt /link -ccopt /subsystem:console" to
each ocamlopt invocation solves the problem but is very boring. I hope you know
the better solution.
P.S. You don't need to bought the whole MS Visual Studio .Net to reproduce the
problem; all this should apply to the Microsoft Visual C++ Toolkit 2003 that is
freely available from http://msdn.microsoft.com/visualc/vctoolkit2003/ (just the
same compiler but without IDE)
The text was updated successfully, but these errors were encountered: