Repository navigation
x64-debug has link error, x64-Release build success #143
Description
Activity
Thanks for using the library and creating an issue report!
@huiseliming here is what you can add right after the
find_packagecall to make it work:# Import target "skyr::skyr-url" for configuration "Debug" set_property(TARGET skyr::skyr-url APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) set_target_properties(skyr::skyr-url PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" IMPORTED_LOCATION_DEBUG "${VCPKG_ROOT}/installed/x64-windows/debug/lib/skyr-urld.lib" )Reacted by Roddy PrattThanks for the response, @Core-Process
It's not easy for me to test using this library on Windows using the package manager. Do you think it's sufficient to add this as a comment in the README file, or can I add that somewhere in the install set up?
@Core-Process
${VCPKG_ROOT}is empty on VS2019I'm sorry to jump into this thread but I think think this is not an issue of
url. The build log shows a mismatch of Visual Studio setting_ITERATOR_DEBUG_LEVEL. This can happen for example if you use the project https://github.com/xtensor-stack/xtensor, that requires_ITERATOR_DEBUG_LEVEL=0. The clean solution is to compile all your projects with the same setting for_ITERATOR_DEBUG_LEVEL. This may be achieved inside vcpkg, or possibly by setting CPPFLAGS="/D_ITERATOR_DEBUG_LEVEL=0" before building the first package.I do not think there is anything this package here can (or should) do.
@emmenlau if that is true, why is it going away with the simple snippet above? :-)
@glynos Its like the debug configuration is not exported properly. I am not a vcpkg expert, therefore unfortunately I have no idea what you would have to do differently.
@emmenlau if that is true, why is it going away with the simple snippet above? :-)
Without reading the snippet above I would assume that this would be a possible solution to the problem. But in my humble opinion its not the clean solution.
Giving flags like
_ITERATOR_DEBUG_LEVEL=0(or similar flags, like/arch:AVX2or/D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGSetcetc) can, and should be, completely in users hands. I.e. with a cmake-based build, set the variablesCFLAGSand/orCXXFLAGSaccordingly, they will be respected by all cmake projects (unless the project explicitly removes flags, which is highly unlikely and probably an error).On a related note, we build literally hundreds of packages with cmake (and even a few other build systems like Perl for OpenSSL) on many platforms, including MSVC with both the Visual Studio Compiler and the Clang compiler. On MSVC we use
_ITERATOR_DEBUG_LEVEL=0amongst other flags for all packages, otherwise they are binary incompatible. None of the packages does anything special to respect or support this setting.This works with
url(amongst many others) without problems.@emmenlau The snippet just makes sure that it links to "skyr-urld.lib" and not "skyr-url.lib" for DEBUG builds. And it fixes the problem here. Maybe it is something that needs to be fixed in this library? ;-)
@coreprocess Maybe I'm missing something but can you say why current url would not already link "skyr-urld.lib"?
I see in my windows build:
#> grep -Irn "urld" lib/cmake/skyr-url lib/cmake/skyr-url/skyr-url-targets-debug.cmake:12: IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/skyr-urld.lib" lib/cmake/skyr-url/skyr-url-targets-debug.cmake:16:list(APPEND _IMPORT_CHECK_FILES_FOR_skyr::skyr-url "${_IMPORT_PREFIX}/lib/skyr-urld.lib" )
Why do you think cmake would not link urld? At least in "plain" cmake this just works.
@emmenlau Interesting, that
skyr-url-targets-debug.cmakedoes not get generated here. At least that is a lead we can have a look at.@coreprocess Yes maybe there is really something fundamentally different in how vcpkg builds or uses cmake. Thanks for following this up!
Thanks for following up! I'm not ignoring this thread, but I don't know yet how to apply a fix here, or if it's something to do with the configuration of vcpkg. I will take a look.
- added a commit that references this issue
on Mar 18, 2024
In Windows using CMake
F:\vcpkg>vcpkg version
skyr-url install by vcpkg
Vcpkg package management program version 2020.02.04-nohash
See LICENSE.txt for license information.
windows\debug\lib\libcrypto.lib F:\vcpkg\installed\x64-windows\debug\lib\fmtd.lib F:\vcpkg\installed\x64-windows\lib\skyr-url.lib F:\vcpkg\installed\x64-windows\debug\lib\gtestd.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:tests\CMakeFiles\tests.dir/intermediate.manifest tests\CMakeFiles\tests.dir/manifest.res" failed (exit code 1319) with the following output:
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(url_search_parameters.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(url_search_parameters.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(url.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(url.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(ipv4_address.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(ipv4_address.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(ipv6_address.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(ipv6_address.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(domain.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(domain.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(parse.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(parse.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(punycode.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(punycode.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(idna.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(idna.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(url_parser_context.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(url_parser_context.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(host.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\skyr-url.lib(host.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in GreyDawnNetworkTest.cpp.obj
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
G:\GreyDawnModule\GreyDawnNetwork\out\build\x64-Debug\bin\tests.exe : fatal error LNK1319: 20 mismatches detected
ninja: build stopped: subcommand failed.
Build All failed.