[PATCH] D20136: Get default -fms-compatibility-version from cl.exe's version

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 9 15:29:50 PST 2017


thakis added a comment.

One consequence from this that I just realized is that linking a binary depending on clang stuff with (morally):

  c++ -o foo foo.o $($LLVMBUILD/bin/llvm-config --ldflags) -lclangFrontend -lclangDriver -lclangParse -lclangSema -lclangSerialization -lclangAnalysis -lclangAST -lclangEdit -lclangLex -lclangBasic $($LLVMBUILD/bin/llvm-config --libs) $($LLVMBUILD/bin/llvm-config --system-libs)

now fails with

  clangDriver.lib(MSVCToolChain.cpp.obj) : error LNK2019: unresolved external symbol GetFileVersionInfoSizeW referenced in
   function "private: class clang::VersionTuple __cdecl clang::driver::toolchains::MSVCToolChain::getMSVCVersionFromExe(vo
  id)const " (?getMSVCVersionFromExe at MSVCToolChain@toolchains at driver@clang@@AEBA?AVVersionTuple at 4@XZ)
  clangDriver.lib(MSVCToolChain.cpp.obj) : error LNK2019: unresolved external symbol GetFileVersionInfoW referenced in fun
  ction "private: class clang::VersionTuple __cdecl clang::driver::toolchains::MSVCToolChain::getMSVCVersionFromExe(void)c
  onst " (?getMSVCVersionFromExe at MSVCToolChain@toolchains at driver@clang@@AEBA?AVVersionTuple at 4@XZ)
  clangDriver.lib(MSVCToolChain.cpp.obj) : error LNK2019: unresolved external symbol VerQueryValueW referenced in function
   "private: class clang::VersionTuple __cdecl clang::driver::toolchains::MSVCToolChain::getMSVCVersionFromExe(void)const
  " (?getMSVCVersionFromExe at MSVCToolChain@toolchains at driver@clang@@AEBA?AVVersionTuple at 4@XZ)
  pptest.exe : fatal error LNK1120: 3 unresolved externals

and folks have to manually add mincore.lib to their link. `llvm-config --system-libs` takes care of things like this for LLVM, but we don't have a `clang-config` as far as I know (does anybody know why not?). So folks now have to manually pass more libraries than just the clang libraries. Not a big deal, but I figured I'd point it out.


Repository:
  rL LLVM

https://reviews.llvm.org/D20136





More information about the cfe-commits mailing list