Mercury Bugs - mercury
View Issue Details
0000465mercuryBugpublic2018-07-27 10:052018-07-27 10:05
Reporteryuan 
Assigned To 
PrioritynormalSeveritytrivialReproducibilityalways
StatusnewResolutionopen 
PlatformMS-VisualC2010OSWindowsOS Version10
Product Version 
Target VersionFixed in Version 
Summary0000465: link lib error when compiling hello.m
DescriptionC:\Users\Yun\Downloads\hello>mmc.bat -v hello
% Parsing module `hello' and imported interfaces...
% Module qualifying items...
% done.
% Expanding equivalence types...
% done.
% Converting parse tree to hlds...
% done.
% Writing auto-dependency file `hello.d'... done.
% Post-processing type definitions...
% Checking typeclasses...
% Checking instance declaration types...
% Checking typeclass instances...
% Checking for cyclic classes...
% Checking for missing concrete instances...
% Checking functional dependencies on instances...
% Checking typeclass constraints...
% Checking that insts have matching types... done.
% Type-checking...
% Type-checking clauses...
% Program is type-correct.
% Purity-checking clauses...
% Program is purity-correct.
% Substituting implementation-defined literals...
% done.
% Transforming polymorphic unifications... done.
% Mode-checking clauses...
% Program is mode-correct.
% Detecting switches...
% done.
% Detecting common deconstructions...
% done.
% Doing determinism checking...
% done.
% Program is determinism-correct.
% Checking for backtracking over unique modes...
% Program is unique-mode-correct.
% Transforming try goals...
% done.
% Simplifying goals...
% done.
% Transforming tabled predicates... done.
% Transforming lambda expressions... done.
% Transforming stm expressions... done.
% Fully expanding equivalence types... done.
% Generating type_ctor_info structures... done.
% Specializing higher-order and polymorphic predicates...
% done.
% Maybe apply source to source debugging transformation ...
% done.
% Inlining...
% done.
% Eliminating dead procedures...
% done.
% Updating interface:
% hello.mh' has not changed.
% Simplifying goals...
% done.
% Marking static ground terms...
% done.
% Mapping args to regs... done.
% Converting HLDS to MLDS...
% done.
% Generating RTTI data...
% done.
% Detecting tail calls...
% done.
% Optimizing MLDS...
% done.
% Flattening nested functions...
% done.
% Optimizing MLDS again...
% done.
% Converting MLDS to C...
% Writing to file `hello.c'...
% done.
% Writing to file `hello.mih.tmp'...
% done.
% Updating interface:
% hello.mih' has not changed.
% Finished converting MLDS to C.
% Compiling `hello.c':
% Invoking system command `cl -IC:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc\inc -IC:\mercury-14.01-vs2013\lib\mercury\conf -IC:\mercury-14.01-vs2013\lib\mercury\inc -DMR_HIGHLEVEL_CODE -DMR_CONSERVATIVE_GC -DMR_BOEHM_GC -DMR_TAGBITS=2 -nologo -c hello.c -Fohello.obj'...
% done.
hello.c
% Touching `hello.c_date'... done.
% Creating initialization file...
% Invoking system command `mkinit -g hlc.gc -o hello_init.c.tmp -I C:\mercury-14.01-vs2013\lib\mercury\modules\hlc.gc -f C:\Users\Yun\AppData\Local\Temp\mtmp002.308'...
% done.
% Updating interface:
% hello_init.c' has not changed.
% Compiling initialization file...
% Compiling `hello_init.c':
% Invoking system command `cl -IC:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc\inc -IC:\mercury-14.01-vs2013\lib\mercury\conf -IC:\mercury-14.01-vs2013\lib\mercury\inc -DMR_HIGHLEVEL_CODE -DMR_CONSERVATIVE_GC -DMR_BOEHM_GC -DMR_TAGBITS=2 -nologo -c hello_init.c -Fohello_init.obj'...
% done.
hello_init.c
% Linking...
% Invoking system command `lib @C:\Users\Yun\AppData\Local\Temp\mtmp002.310'...
% done.
% Invoking system command `echo C:\Users\Yun\AppData\Local\Temp\mtmp002.30E.lib'...
% done.
C:\Users\Yun\AppData\Local\Temp\mtmp002.30E.lib
% Invoking system command `cl -Fehello.exe C:\Users\Yun\AppData\Local\Temp\mtmp002.30E.lib -link -LIBPATH:C:\mercury-14.01-vs2013\lib\mercury\lib -LIBPATH:C:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc -nologo -subsystem:console -machine:x86 -entry:wmainCRTStartup -defaultlib:libcmt C:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc\libmer_std.lib C:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc\libmer_rt.lib C:\mercury-14.01-vs2013\lib\mercury\lib\libgc.lib '...


C:\Users\Yun\Downloads\hello>cl -Fehello.exe C:\Users\Yun\AppData\Local\Temp\mtmp002.30E.lib -link -LIBPATH:C:\mercury-14.01-vs2013\lib\mercury\lib -LIBPATH:C:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc -nologo -subsystem:console -machine:x86 -entry:wmainCRTStartup -defaultlib:libcmt C:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc\libmer_std.lib C:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc\libmer_rt.lib C:\mercury-14.01-vs2013\lib\mercury\lib\libgc.lib
LINK : warning LNK4001: Object file not specified; library used
libmer_std.lib(io.obj) : error LNK2019: Unresolved external symbol ___report_rangecheckfailure, this symbol is referenced in function _mercury__io__read_char_code_2_4_p_0
libmer_std.lib(parsing_utils.obj) : error LNK2001: Unresolved external symbol ___report_rangecheckfailure
libmer_std.lib(string.obj) : error LNK2001: Unresolved external symbol ___report_rangecheckfailure
libgc.lib(dbg_mlc.obj) : error LNK2001: Unresolved external symbol ___report_rangecheckfailure
libmer_rt.lib(mercury_wrapper.obj) : error LNK2019: Unresolved external symbol _fesetround, this symbol is referenced in function _MR_process_options
libmer_rt.lib(mercury_float.obj) : error LNK2019: Unresolved external symbol __dclass, the symbol is referenced in function _MR_is_nan
hello.exe : fatal error LNK1120: 3 external commands that cannot be resolved
Steps To Reproduce1. create a hello.m in the tutorial https://www.mercurylang.org/documentation/papers/book.pdf
2. run mmc.bat --make hello -v in cmd
3. run cl -Fehello.exe C:\Users\Yun\AppData\Local\Temp\mtmp002.30E.lib -link -LIBPATH:C:\mercury-14.01-vs2013\lib\mercury\lib -LIBPATH:C:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc -nologo -subsystem:console -machine:x86 -entry:wmainCRTStartup -defaultlib:libcmt C:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc\libmer_std.lib C:\mercury-14.01-vs2013\lib\mercury\lib\hlc.gc\libmer_rt.lib C:\mercury-14.01-vs2013\lib\mercury\lib\libgc.lib in cmd
TagsNo tags attached.
Attached Files

There are no notes attached to this issue.

Issue History
2018-07-27 10:05yuanNew Issue