getboost icon indicating copy to clipboard operation
getboost copied to clipboard

How to use boost.targets in VS2019?

Open aarumug opened this issue 3 years ago • 2 comments

I specified the following in packages.config and restored the package. And that downloaded all the boost headers and boost.1.72.0.0\build\boost.targets

  <package id="Boost" version="1.72.0.0" />
  <package id="Boost-vc142" version="1.72.0.0" />

I also added the following to the vcxproj:

<Import Project="..\packages\boost-vc142.1.72.0.0\build\boost-vc142.targets" Condition="Exists('..\packages\boost-vc142.1.72.0.0\build\boost-vc142.targets')" />

The header files are getting referenced properly but in linking phase I still get:

Error LNK1104 cannot open file 'libboost_program_options-vc142-mt-x64-1_72.lib' What step am I missing?

aarumug avatar Nov 10 '20 19:11 aarumug

After adding $(SolutionDir)packages\boost.1.72.0.0\build; to the vcxproj <AdditionalDependencies> under <Link>, I'm getting the following error:

1>LINK : fatal error LNK1181: cannot open input file 'packages\boost.1.72.0.0\build.obj'

aarumug avatar Nov 10 '20 20:11 aarumug

Some boost packages are not header only. Maybe adding just https://www.nuget.org/packages/boost_program_options-vc142/ directly enables the finding of the lib for linking.

chcg avatar Nov 27 '20 22:11 chcg