Skip to content

Unresolved external symbol in the C++ standard library for builds on image 20220814.1 #6091

@DSMitten

Description

@DSMitten

Description

Our build pipelines started failing today with the rollout of image 20220814.1 for windows-latest VM images.

We use vcpkg in our repo, and install the benchmark library with it, and build one of our target exes against that library. The library calls something in the standard library that uses _Find_unchecked which calls __std_find_trivial. The error is a linker error so somehow it is finding a forward declaration in the header file but not actually building the function, so by the time we are linking it, we hit unresolved external symbol errors.

We are completely blocked from building due to this. It doesn't repro on our local dev machines. Some of us have VS2022 17.2, some 17.3. None of us are hitting this build error locally - it only happens on the VM images.

Platforms affected

  • Azure DevOps
  • GitHub Actions

Virtual environments affected

  • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 10.15
  • macOS 11
  • macOS 12
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

20220814.1

https://outlookweb.visualstudio.com/Outlook%20Web/_build/results?buildId=584985&view=logs&j=2678756e-65ab-598a-5894-e8f6dcceee25&t=9302dfd4-b676-4014-979a-8e5ff127e473

All of our builds are failing when built on machines with the new image because we link against the vcpkg benchmark library, and somehow it is compiling against in the standard library, fidns __std_find_trivial forward declared, but doesn't actually compile the function, resulting in a linker error due to an unresolved external symbol.

Is it regression?

20220808.1

Expected behavior

'benchmark' vcpkg package can be used as a dependency and linked successfully

Actual behavior

Build fails because google benchmark library included with vcpkg somehow has an unresolved external symbol from the standard library. This doesn't repro in the previous image or on our local dev machines.

Creating library [our target path].lib and object [our target path].exp
##[error] benchmark.lib(benchmark_register.cc.obj) : error LNK2019: unresolved external symbol __std_find_trivial_1 referenced in function "char const * __cdecl std::_Find_unchecked<char const *,unsigned char>(char const *,char const * const,unsigned char const &)" (??$_Find_unchecked@PEBDE@std@@YAPEBDPEBDQEBDAEBE@Z)
##[error] src\plat\win\win32\app\test\perftest_GoogleBenchmark\olkwin32-test-perf.exe : fatal error LNK1120: 1 unresolved externals

Repro steps

The only repro we know of is to build our project.

Metadata

Metadata

Assignees

Labels

OS: Windowsawaiting-deploymentCode complete; awaiting deployment and/or deployment in progressbug reportinvestigateCollect additional information, like space on disk, other tool incompatibilities etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions