I'm working in a Visual Studio Project that was generated using CMake, and for some reason, I get an LNK1104 error on build saying "cannot open file 'hboost_python27-vc142-mt-x64-1_72.lib'" and I know for a fact that that file does not exist anywhere and that the correct dependency is "hboost_python27-mt-x64.lib." So why is Visual Studio asking for this file? How would I go about deriving where this filename is coming from, and then fixing it? Is this more of a CMake issue? Or a Visual Studio issue?
For reference, I'm compiling a custom USD Asset Resolver for Houdini, and here is the code I was working on https://github.com/mwalk176/USD-Custom-Resolver-Windows-Example/tree/main/custom_resolver/project
I think you have quite old version of Boost installed on your PC, starting from quite recent versions of Boost it is a standard way to write more verbose syntax like
hboost_python27-vc142-mt-x64-1_72.lib
, so it is correct.Try downloading Boost 1.72 from here or if your code is compatible with more recent versions of Boost then it is better to download latest version which is 1.78 download right now.
Otherwise in your file system copy file
hboost_python27-mt-x64.lib
over tohboost_python27-vc142-mt-x64-1_72.lib
, or make Windows hard link. This way it will be found when compiling.Another option is that you modify your current code
to shorter version:
after this change this pragma code will produce expected file name
hboost_python27-mt-x64.lib
.