NREL / openstudio-gems

1 stars 2 forks source link

Ruby3 - Link error due to mistmached MSVC runtime with unf_ext via json_schemer #72

Open jmarrec opened 7 months ago

jmarrec commented 7 months ago
[ 50%][1/2] Linking CXX shared module Products\rubyengine.dll
FAILED: Products/rubyengine.dll
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=ruby\engine\CMakeFiles\rubyengine.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\rubyengine.rsp  /out:Products\rubyengine.dll /implib:Products\rubyengine.lib /pdb:Products\rubyengine.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL  /NODEFAULTLIB:MSVCRT  && cd ."
LINK Pass 1: command "C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\rubyengine.rsp /out:Products\rubyengine.dll /implib:Products\rubyengine.lib /pdb:Products\rubyengine.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL /NODEFAULTLIB:MSVCRT /MANIFEST /MANIFESTFILE:ruby\engine\CMakeFiles\rubyengine.dir/intermediate.manifest ruby\engine\CMakeFiles\rubyengine.dir/manifest.res" failed (exit code 1319) with the following output:
extinit.obj : warning LNK4099: PDB '' was not found with 'extinit.obj' or at ''; linking object as if no debug info
encinit.obj : warning LNK4099: PDB '' was not found with 'encinit.obj' or at ''; linking object as if no debug info
unf_ext.lib(unf.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in InitRubyBindings.cpp.obj
unf_ext.lib(unf.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in InitRubyBindings.cpp.obj
jmarrec commented 7 months ago
C:\src\OS-build-debug-v2\openstudio-gems\ruby\3.2.0\gems>dumpbin /nologo /directives unf_ext-0.0.9.1\ext\unf_ext\unf_ext.lib

Dump of file unf_ext-0.0.9.1\ext\unf_ext\unf_ext.lib

File Type: LIBRARY

   Linker Directives
   -----------------
   /FAILIFMISMATCH:_CRT_STDIO_ISO_WIDE_SPECIFIERS=0
   /FAILIFMISMATCH:_MSC_VER=1900
   /FAILIFMISMATCH:_ITERATOR_DEBUG_LEVEL=0
   /FAILIFMISMATCH:RuntimeLibrary=MD_DynamicRelease
   /DEFAULTLIB:msvcprt
   /FAILIFMISMATCH:annotate_string=0
   /FAILIFMISMATCH:annotate_vector=0
   /DEFAULTLIB:uuid.lib
   /DEFAULTLIB:uuid.lib
   /DEFAULTLIB:MSVCRT
   /DEFAULTLIB:OLDNAMES

compared to

C:\src\OS-build-debug-v2\openstudio-gems\ruby\3.2.0\gems>dumpbin /nologo /directives oga-3.2\ext\c\liboga.lib

Dump of file oga-3.2\ext\c\liboga.lib

File Type: LIBRARY

   Linker Directives
   -----------------
   /DEFAULTLIB:uuid.lib
   /DEFAULTLIB:uuid.lib
   /DEFAULTLIB:MSVCRT
   /DEFAULTLIB:OLDNAMES

   Linker Directives
   -----------------
   /DEFAULTLIB:uuid.lib
   /DEFAULTLIB:uuid.lib
   /DEFAULTLIB:MSVCRT
   /DEFAULTLIB:OLDNAMES
jmarrec commented 7 months ago

$ bundle viz

gem_graph

jmarrec commented 7 months ago

bundle viz --format svg -R

gem_graph