Vcpkg: chromium-base breaks the x64 Debug configuration of projects that use VCPKG.

Created on 13 Sep 2020  路  10Comments  路  Source: microsoft/vcpkg

Installing the chromium-base package breaks the x64 Debug configuration of projects that use VCPKG unless you disable the VcpkgAutoLink feature of vcpkg.targets. The VcpkgAutoLink feature causes double_conversion.lib to be imported. Then the errors begin.

double_conversion.lib(string-to-double.obj):
error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'

double_conversion.lib(strtod.obj):
error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'

double_conversion.lib(bignum.obj):
error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'

double_conversion.lib(cached-powers.obj):
error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'

msvcprtd.lib(MSVCP140D.dll):
error LNK2005: "public: __cdecl std::_Locinfo::_Locinfo(char const *)" (??0_Locinfo@std@@QEAA@PEBD@Z)
already defined in double_conversion.lib(string-to-double.obj)

msvcprtd.lib(MSVCP140D.dll):
error LNK2005: "public: __cdecl std::_Locinfo::~_Locinfo(void)" (??1_Locinfo@std@@QEAA@XZ)
already defined in double_conversion.lib(string-to-double.obj)

msvcprtd.lib(MSVCP140D.dll):
error LNK2005: "public: struct _Cvtvec __cdecl std::_Locinfo::_Getcvt(void)const "
(?_Getcvt@_Locinfo@std@@QEBA?AU_Cvtvec@@XZ) already defined in double_conversion.lib(string-to-double.obj)

msvcprtd.lib(MSVCP140D.dll):
error LNK2005: "public: unsigned short const * __cdecl std::_Locinfo::_W_Getdays(void)const "
(?_W_Getdays@_Locinfo@std@@QEBAPEBGXZ) already defined in double_conversion.lib(string-to-double.obj)

msvcprtd.lib(MSVCP140D.dll):
error LNK2005: "public: unsigned short const * __cdecl std::_Locinfo::_W_Getmonths(void)const "
(?_W_Getmonths@_Locinfo@std@@QEBAPEBGXZ) already defined in double_conversion.lib(string-to-double.obj)

msvcprtd.lib(MSVCP140D.dll):
error LNK2005: "public: char const * __cdecl std::_Yarn<char>::c_str(void)const "
(?c_str@?$_Yarn@D@std@@QEBAPEBDXZ) already defined in double_conversion.lib(string-to-double.obj)

msvcprtd.lib(MSVCP140D.dll):
error LNK2005: "public: static void * __cdecl std::_Crt_new_delete::operator new(unsigned __int64)"
(??2_Crt_new_delete@std@@SAPEAX_K@Z) already defined in double_conversion.lib(string-to-double.obj)

msvcprtd.lib(MSVCP140D.dll):
error LNK2005: "public: static void __cdecl std::_Crt_new_delete::operator delete(void *)"
(??3_Crt_new_delete@std@@SAXPEAX@Z) already defined in double_conversion.lib(string-to-double.obj)

msvcprtd.lib(MSVCP140D.dll):
error LNK2005: "public: __cdecl std::locale::id::operator unsigned __int64(void)"
(??Bid@locale@std@@QEAA_KXZ) already defined in double_conversion.lib(string-to-double.obj)

msvcprtd.lib(MSVCP140D.dll):
error LNK2005: "protected: __cdecl std::locale::facet::facet(unsigned __int64)"
(??0facet@locale@std@@IEAA@_K@Z) already defined in double_conversion.lib(string-to-double.obj)

msvcprtd.lib(MSVCP140D.dll): error LNK2005: "protected: virtual __cdecl std::locale::facet::~facet(void)"
(??1facet@locale@std@@MEAA@XZ) already defined in double_conversion.lib(string-to-double.obj)

fatal error LNK1169: one or more multiply defined symbols found

Environment

  • OS: Windows 10 Pro Version 2004 build 19041.508 with Windows Feature Experience Pack 120.2212.31.0.
  • Compiler: Microsoft Visual Studio Community 2019 Version 16.7.3

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install chromium-base --triplet x64-windows
  2. Open any project that is configured to use VCPKG in Visual Studio.
  3. Build the x64 Debug configuration.
  4. See the above errors.

Expected behavior
No errors.

port-bug

All 10 comments

error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'
It looks like you are using the debug library instead of the release library.
Can you provide a simple project?

It looks like you are using the debug library instead of the release library.

I am not certain what you mean.

I am building the 64-bit debug configuration of the project. I modified the settings of the project so that it shows progress messages. I confirmed that it is pulling in chromium-base.lib from ${VCPKG_ROOT}\installedx64-windows\debug\lib. Thus the debug version of the library is the one that is supposed to be used in this case.

Note that based on a Google search for "mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2'"" this is exactly the error that would happen if you attempted to link to a Release LIB file when building the Debug configuration of your project.

Can you provide a simple project?

I no longer have Chromium-Base installed. I removed it before I even reported this issue. So, at the moment, no I cannot supply a project.

However, if my guess as to what caused the issue is correct you can reproduce the issue with any project of your choosing.

  1. Install VCPKG.
  2. Run the integrate command.
  3. Install Chromium-Base.
  4. Open any project you already have on your system that has an x64 debug configuration.
  5. Build the project.
  6. See the errors.

@BenKey You may use the debug chromium library in your release project.
See msdn docs.

@BenKey You may use the debug chromium library in your release project.
See msdn docs.

Are you even reading my messages? See msdn docs is NOT THE CORRECT RESPONSE TO THIS ISSUE.

I am build the DEBUG build of my project. I have confirmed that the project is linking with the DEBUG LIB (or at least the one put in the DEBUG directory by the BUILD PROCESS}.

Then errors occur.

I did not say I am linking with the release version of the lib. I only mentioned that it is BEHAVING like I am linking with the release version. I actually am linking with the DEBUG version of the lib in the DEBUG configuration.

It should work.

Something is wrong with the build process of Chromium Base. I do not know what but my problem has nothing to do with the page you linked to.

This is not a QUESTION., This is a BUG. If a DEBUG configuration of a project links with a DEBUG version of a lib, which is exactly;y what I am doing, these errors should not occur!.

I'm not sure that your project or chromium uses double_conversion.
If it is your project, it means that you have used the Release library in the Debug configuration. If it is chromium, it must be a port bug.

@vejmartin Can you please take a look?

Thanks.

I'm not sure that your project or chromium uses double_conversion.

I am building my project. However, the only reason it it attempting to link with chromium-base.lib is the VcpkgAutoLink feature of vcpkg.targets that adds ${VCPKG_ROOT}\installedx64-windows\debug\lib*.lib to the AdditionalDependencies list.

If it is your project, it means that you have used the Release library in the Debug configuration. If it is chromium, it must be a port bug.

Again, I question whether you are bothering to read my replies.

You made the incorrect claim that "it means that you have used the Release library in the Debug configuration." As I keep saying again and again I am using the DEBUG configuration of my project (that much of your inaccurate claim is correct) but I am NOT using the RELEASE library. As I said, I enabled the show progress messages setting so I can see where the chromium base library is being pulled from. It is being pulled from ${VCPKG_ROOT}\installedx64-windows\debug\lib which is the location where the DEBUG version of the library is, or at least should be, located. This is the bug I am reporting.

It most definitely is a port bug. A short description of the port bug is as follows.

If you build the x64 Debug version of your personal project and it links with the chromium-base.lib file found in ${VCPKG_ROOT}\installedx64-windows\debug\lib, which should be the location of the debug version of chromium-base.lib you get linking errors.

@BenKey, this issue is due to the iterator debugging levels being different between the chromium-base library and the rest of the targets being compiled. chromium-base requires iterator debugging to be disabled, and this is a setting that must be applied project-wide as it affects the flavor of the standard library.

Please see my comment on the chromium-base PR and the iterator-debug docs for more information.

The compiler definition could be added to the CMake config for the chromium-base library, but linking to chromium-base may still fail if other libraries with a different IDL are linked. I'm not familiar with the VcpkgAutoLink feature. However, assuming that it links all the installed libraries in vcpkg, then uninstalling chromium-base might be the safest route (as you've already done). For working with it, a custom triplet (e.g. a copy of x64-windows) could be defined, so that the install can be separated from the regular VcpkgAutoLink.

I'm not sure that your project or chromium uses double_conversion.

I am building my project. However, the only reason it it attempting to link with chromium-base.lib is the VcpkgAutoLink feature of vcpkg.targets that adds ${VCPKG_ROOT}\installedx64-windows\debug\lib*.lib to the AdditionalDependencies list.

If it is your project, it means that you have used the Release library in the Debug configuration. If it is chromium, it must be a port bug.

Again, I question whether you are bothering to read my replies.

You made the incorrect claim that "it means that you have used the Release library in the Debug configuration." As I keep saying again and again I am using the DEBUG configuration of my project (that much of your inaccurate claim is correct) but I am NOT using the RELEASE library. As I said, I enabled the show progress messages setting so I can see where the chromium base library is being pulled from. It is being pulled from ${VCPKG_ROOT}\installedx64-windows\debug\lib which is the location where the DEBUG version of the library is, or at least should be, located. This is the bug I am reporting.

It most definitely is a port bug. A short description of the port bug is as follows.

If you build the x64 Debug version of your personal project and it links with the chromium-base.lib file found in ${VCPKG_ROOT}\installedx64-windows\debug\lib, which should be the location of the debug version of chromium-base.lib you get linking errors.

  1. vcpkg will check their _ITERATOR_DEBUG_LEVEL, CRT_LINKAGE and other flags after the port is built to ensure correctness.

  2. The intergrate command will automatically import all libraries in _VCPKG_ROOT/installed/${TRIPLET}/debug/lib_ / _VCPKG_ROOT/installed/${TRIPLET}/lib_ according to the configuration of the current user project.

So most of these errors are due to user project configuration errors.
And sorry, I cannot locate the problem accurately based on the information you provided.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tzbo picture tzbo  路  3Comments

F0I0l0I0P picture F0I0l0I0P  路  3Comments

pakdel picture pakdel  路  3Comments

cskrisz picture cskrisz  路  3Comments

LilyWangL picture LilyWangL  路  3Comments