Support for static Boost builds
- Dominant language
- Wolfram Language
- Stars
- 905
- Forks
- 223
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 16
Description
**Describe the issue**
Using a static build of Boost results in a linker error like the one seen below in the build log. The root cause is the build system setting [BOOST_ALL_DYN_LINK](https://github.com/Autodesk/maya-usd/blob/c95fcf2c82b8dac659b09bcdd2898e6fab2484f2/cmake/compiler_config.cmake#L46) which forces Boost to use the dynamic symbol names.
**Build log**
```
Creating library D:/pkg/bfd/ext/mayaplugins/usd/build/windows_x64_msvc14_release_maya201900_python2.7/lib/mayaUsd/Release/mayaUsd.lib and object D:/pkg/bfd/ext/mayaplugins/usd/build/windows_x64_msvc14_release_maya201900_python2.7/lib/mayaUsd/Release/mayaUsd.exp
7>proxyShapeBase.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::system_category(void)" (__imp_?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'native_ecat''(void)" (??__Enative_ecat@system@boost@@YAXXZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>material.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::system_category(void)" (__imp_?system_category@system@boost@@YAAEBVerror_category@12@XZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>utilFileSystem.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::system_category(void)" (__imp_?system_category@system@boost@@YAAEBVerror_category@12@XZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>proxyShapeBase.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (__imp_?generic_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'errno_ecat''(void)" (??__Eerrno_ecat@system@boost@@YAXXZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>material.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (__imp_?generic_category@system@boost@@YAAEBVerror_category@12@XZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>utilFileSystem.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (__imp_?generic_category@system@boost@@YAAEBVerror_category@12@XZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>proxyShapeBase.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string,class std::allocator > &,class std::codecvt const &)" (__imp_?convert@path_traits@filesystem@boost@@YAXPEBD0AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$codecvt@_WDU_Mbstatet@@@5@@Z) referenced in function "private: class Autodesk::Maya::OpenMaya20190000::MStatus __cdecl pxrInternal_v0_20__pxrReserved__::MayaUsdProxyShapeBase::computeInStageDataCached(class Autodesk::Maya::OpenMaya20190000::MDataBlock &)" (?computeInStageDataCached@MayaUsdProxyShapeBase@pxrInternal_v0_20__pxrReserved__@@AEAA?AVMStatus@OpenMaya20190000@Maya@Autodesk@@AEAVMDataBlock@456@@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>material.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string,class std::allocator > &,class std::codecvt const &)" (__imp_?convert@path_traits@filesystem@boost@@YAXPEBD0AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$codecvt@_WDU_Mbstatet@@@5@@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>utilFileSystem.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string,class std::allocator > &,class std::codecvt const &)" (__imp_?convert@path_traits@filesystem@boost@@YAXPEBD0AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$codecvt@_WDU_Mbstatet@@@5@@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>proxyShapeBase.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl boost::filesystem::path::is_absolute(void)const " (__imp_?is_absolute@path@filesystem@boost@@QEBA_NXZ) referenced in function "private: class Autodesk::Maya::OpenMaya20190000::MStatus __cdecl pxrInternal_v0_20__pxrReserved__::MayaUsdProxyShapeBase::computeInStageDataCached(class Autodesk::Maya::OpenMaya20190000::MDataBlock &)" (?computeInStageDataCached@MayaUsdProxyShapeBase@pxrInternal_v0_20__pxrReserved__@@AEAA?AVMStatus@OpenMaya20190000@Maya@Autodesk@@AEAVMDataBlock@456@@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>proxyShapeBase.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class std::codecvt const & __cdecl boost::filesystem::path::codecvt(void)" (__imp_?codecvt@path@filesystem@boost@@SAAEBV?$codecvt@_WDU_Mbstatet@@@std@@XZ) referenced in function "private: class Autodesk::Maya::OpenMaya20190000::MStatus __cdecl pxrInternal_v0_20__pxrReserved__::MayaUsdProxyShapeBase::computeInStageDataCached(class Autodesk::Maya::OpenMaya20190000::MDataBlock &)" (?computeInStageDataCached@MayaUsdProxyShapeBase@pxrInternal_v0_20__pxrReserved__@@AEAA?AVMStatus@OpenMaya20190000@Maya@Autodesk@@AEAVMDataBlock@456@@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>material.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::codecvt const & __cdecl boost::filesystem::path::codecvt(void)" (__imp_?codecvt@path@filesystem@boost@@SAAEBV?$codecvt@_WDU_Mbstatet@@@std@@XZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>utilFileSystem.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class std::codecvt const & __cdecl boost::filesystem::path::codecvt(void)" (__imp_?codecvt@path@filesystem@boost@@SAAEBV?$codecvt@_WDU_Mbstatet@@@std@@XZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>proxyShapeBase.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::filesystem::path::~path(void)" (__imp_??1path@filesystem@boost@@QEAA@XZ) referenced in function "private: class Autodesk::Maya::OpenMaya20190000::MStatus __cdecl pxrInternal_v0_20__pxrReserved__::MayaUsdProxyShapeBase::computeInStageDataCached(class Autodesk::Maya::OpenMaya20190000::MDataBlock &)" (?computeInStageDataCached@MayaUsdProxyShapeBase@pxrInternal_v0_20__pxrReserved__@@AEAA?AVMStatus@OpenMaya20190000@Maya@Autodesk@@AEAVMDataBlock@456@@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>material.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::filesystem::path::~path(void)" (__imp_??1path@filesystem@boost@@QEAA@XZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>utilFileSystem.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::filesystem::path::~path(void)" (__imp_??1path@filesystem@boost@@QEAA@XZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>material.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __cdecl boost::filesystem::path::c_str(void)const " (__imp_?c_str@path@filesystem@boost@@QEBAPEB_WXZ) referenced in function "public: virtual void __cdecl pxrInternal_v0_20__pxrReserved__::HdVP2Material::Sync(class pxrInternal_v0_20__pxrReserved__::HdSceneDelegate *,class pxrInternal_v0_20__pxrReserved__::HdRenderParam *,unsigned int *)" (?Sync@HdVP2Material@pxrInternal_v0_20__pxrReserved__@@UEAAXPEAVHdSceneDelegate@2@PEAVHdRenderParam@2@PEAI@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>material.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > const __cdecl boost::filesystem::path::string(void)const " (__imp_?string@path@filesystem@boost@@QEBA?BV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: virtual void __cdecl pxrInternal_v0_20__pxrReserved__::HdVP2Material::Sync(class pxrInternal_v0_20__pxrReserved__::HdSceneDelegate *,class pxrInternal_v0_20__pxrReserved__::HdRenderParam *,unsigned int *)" (?Sync@HdVP2Material@pxrInternal_v0_20__pxrReserved__@@UEAAXPEAVHdSceneDelegate@2@PEAVHdRenderParam@2@PEAI@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>utilFileSystem.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string,class std::allocator > const __cdecl boost::filesystem::path::string(void)const " (__imp_?string@path@filesystem@boost@@QEBA?BV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>material.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: unsigned __int64 __cdecl boost::filesystem::path::m_append_separator_if_needed(void)" (__imp_?m_append_separator_if_needed@path@filesystem@boost@@AEAA_KXZ) referenced in function "public: class boost::filesystem::path & __cdecl boost::filesystem::path::append(char const (&)[15])" (??$append@$$BY0P@D@path@filesystem@boost@@QEAAAEAV012@AEAY0P@$$CBD@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>material.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: void __cdecl boost::filesystem::path::m_erase_redundant_separator(unsigned __int64)" (__imp_?m_erase_redundant_separator@path@filesystem@boost@@AEAAX_K@Z) referenced in function "public: class boost::filesystem::path & __cdecl boost::filesystem::path::append(char const (&)[15])" (??$append@$$BY0P@D@path@filesystem@boost@@QEAAAEAV012@AEAY0P@$$CBD@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>material.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::filesystem::path __cdecl boost::filesystem::detail::temp_directory_path(class boost::system::error_code *)" (__imp_?temp_directory_path@detail@filesystem@boost@@YA?AVpath@23@PEAVerror_code@system@3@@Z) referenced in function "public: virtual void __cdecl pxrInternal_v0_20__pxrReserved__::HdVP2Material::Sync(class pxrInternal_v0_20__pxrReserved__::HdSceneDelegate *,class pxrInternal_v0_20__pxrReserved__::HdRenderParam *,unsigned int *)" (?Sync@HdVP2Material@pxrInternal_v0_20__pxrReserved__@@UEAAXPEAVHdSceneDelegate@2@PEAVHdRenderParam@2@PEAI@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>utilFileSystem.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class boost::filesystem::path __cdecl boost::filesystem::path::parent_path(void)const " (__imp_?parent_path@path@filesystem@boost@@QEBA?AV123@XZ) referenced in function "class std::basic_string,class std::allocator > __cdecl pxrInternal_v0_20__pxrReserved__::UsdMayaUtilFileSystem::getDir(class std::basic_string,class std::allocator > const &)" (?getDir@UsdMayaUtilFileSystem@pxrInternal_v0_20__pxrReserved__@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>utilFileSystem.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::filesystem::path __cdecl boost::filesystem::detail::canonical(class boost::filesystem::path const &,class boost::filesystem::path const &,class boost::system::error_code *)" (__imp_?canonical@detail@filesystem@boost@@YA?AVpath@23@AEBV423@0PEAVerror_code@system@3@@Z) referenced in function "class std::basic_string,class std::allocator > __cdecl pxrInternal_v0_20__pxrReserved__::UsdMayaUtilFileSystem::resolveRelativePathWithinMayaContext(class Autodesk::Maya::OpenMaya20190000::MObject const &,class std::basic_string,class std::allocator > const &)" (?resolveRelativePathWithinMayaContext@UsdMayaUtilFileSystem@pxrInternal_v0_20__pxrReserved__@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVMObject@OpenMaya20190000@Maya@Autodesk@@AEBV34@@Z) [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\Release\mayaUsd.dll : fatal error LNK1120: 13 unresolved externals [D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj]
7>Done Building Project "D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\lib\mayaUsd\mayaUsd.vcxproj" (default targets) -- FAILED.
11>Done Building Project "D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\plugin\pxr\maya\lib\usdMaya\usdMaya.vcxproj" (default targets) -- FAILED.
10>Done Building Project "D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\plugin\pxr\maya\lib\usdMaya\_usdMaya.vcxproj" (default targets) -- FAILED.
5>Done Building Project "D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\plugin\pxr\python.vcxproj" (default targets) -- FAILED.
4>Done Building Project "D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\plugin\adsk\plugin\mayaUsdPlugin.vcxproj" (default targets) -- FAILED.
3>Done Building Project "D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\ALL_BUILD.vcxproj" (default targets) -- FAILED.
1>Done Building Project "D:\pkg\bfd\ext\mayaplugins\usd\build\windows_x64_msvc14_release_maya201900_python2.7\install.vcxproj" (default targets) -- FAILED.
```
**Specs:**
- Windows 10
- Visual Studio 2017
- Maya version: Maya 2019
- Maya USD commit SHA: 62037f387 (0.5.0)
- Pixar USD commit SHA: 71b4baace (20.08)
**Additional context**
To work around, you can just delete the define.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in cmake/compiler_config.cmake at the BOOST_ALL_DYN_LINK setting and review how the build config handles static versus dynamic Boost libraries. Reproduce the Windows static Boost build from the reported log, then verify that the mayaUsd link completes without the unresolved Boost symbols.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100