8000 Failed to link tests to msvcurt(d) library with MSVC 15.6.4 · Issue #73 · lewissbaker/cppcoro · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Failed to link tests to msvcurt(d) library with MSVC 15.6.4 #73
Closed
@grishavanika

Description

@grishavanika

Hi,

I'm getting error described in the title.

My environment is next:

  • cl version: 19.13.26129
  • MSVC: Microsoft Visual Studio Community 2017; Version 15.6.4; VisualStudio.15.Release/15.6.4+27428.2015
  • MSVC is installed in non-default directory: C:/Programs/Microsoft Visual Studio

Dumping compiler.getLibraryPaths() on line 82 in config.cake gives next folders:

['C:\\Programs\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\lib\\x64',
 'C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.16299.0\\ucrt\\x64',
 'C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.16299.0\\um\\x64']

Running cake with command line like: cake.bat release=debug architecture=x64 gives next error:

Archiving build\windows_x64_msvc15_debug\lib\cppcoro.lib
Linking build\windows_x64_msvc15_debug\test\run.exe
LINK : fatal error LNK1104: cannot open file 'msvcurtd.lib'
C:\Programs\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX64\x64\link.exe: failed with exit code 1104
Build failed with 1 errors.
The following targets failed to build:
- build/windows_x64_msvc15_debug/test/run.exe

I did "fix" locally like this one:

    libraryPaths=[vcLibDir] + ucrtInfo.libDirs + windowsSdkInfo.libDirs
      + ["C:\\Programs\\Microsoft Visual Studio\\2017\\Community\\SDK\\ScopeCppSDK\\VC\\lib"],

in tools\cake\src\cake\library\compilers\msvc.py file, getVisualStudio2017Compiler() and everything works fine.

Am I missing something ?
Will be glad to help you with anything :)

Thanks

UPD: also, x86 builds require to link with vcruntime library, otherwise, there are linker errors:

1>Linking build\windows_x86_msvc15_optimised\test\run.exe
1>main.obj : error LNK2001: unresolved external symbol ___CxxFrameHandler3
1>main.obj : error LNK2001: unresolved external symbol _memmove
1>main.obj : error LNK2001: unresolved external symbol __purecall
1>main.obj : error LNK2001: unresolved external symbol ___std_terminate
1>main.obj : error LNK2001: unresolved external symbol _strstr
1>main.obj : error LNK2001: unresolved external symbol _strrchr
1>recursive_generator_tests.obj : error LNK2001: unresolved external symbol ___std_exception_destroy
1>msvcrt.lib(throw_bad_alloc.obj) : error LNK2001: unresolved external symbol ___std_exception_destroy
1>recursive_generator_tests.obj : error LNK2001: unresolved external symbol ___std_exception_copy
1>msvcrt.lib(throw_bad_alloc.obj) : error LNK2001: unresolved external symbol ___std_exception_copy
1>file_tests.obj : error LNK2001: unresolved external symbol ___std_type_info_compare
1>msvcrt.lib(thread_safe_statics.obj) : error LNK2001: unresolved external symbol ___vcrt_InitializeCriticalSectionEx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0