Hello,
I had to rebuild usd to a new install, USD was correctly built without any error.
For that, I used the build_scripts.py with those arguments, --embree and --python.
After USD was built, I created a basic CMakeList, put the path of USD as they said after I built USD.
Once I want to compile a simple program, I am getting a linker errors.
Here are the errors:
C:\WINDOWS\system32\cmd.exe /C "cd . && "C:\Program Files\JetBrains\CLion 2024.3.1.1\bin\cmake\win\x64\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\testUSD.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\x64\link.exe /nologo CMakeFiles\testUSD.dir\main.cpp.obj /out:testUSD.exe /implib:testUSD.lib /pdb:testUSD.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console -LIBPATH:C:\Users\matth\OneDrive\Documents\DEV\Librairies\USD_Binairies\lib -LIBPATH:C:\Users\matth\AppData\Local\Programs\Python\Python311\libs -LIBPATH:C:\Users\matth\AppData\Local\Programs\Python\Python311\include usd_usdGeom.lib usd_usd.lib usd_sdf.lib usd_vt.lib usd_tf.lib usd_usdUtils.lib usd_boost.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK: command "C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\x64\link.exe /nologo CMakeFiles\testUSD.dir\main.cpp.obj /out:testUSD.exe /implib:testUSD.lib /pdb:testUSD.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console -LIBPATH:C:\Users\matth\OneDrive\Documents\DEV\Librairies\USD_Binairies\lib -LIBPATH:C:\Users\matth\AppData\Local\Programs\Python\Python311\libs -LIBPATH:C:\Users\matth\AppData\Local\Programs\Python\Python311\include usd_usdGeom.lib usd_usd.lib usd_sdf.lib usd_vt.lib usd_tf.lib usd_usdUtils.lib usd_boost.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1" failed (exit code 1120) with the following output:
main.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) struct pxrInternal_v0_24_11__pxrReserved__::pxr_boost::python::converter::registration const & __cdecl pxrInternal_v0_24_11__pxrReserved__::pxr_boost::python::converter::registry::lookup(struct pxrInternal_v0_24_11__pxrReserved__::pxr_boost::python::type_info)" (__imp_?lookup@registry@converter@python@pxr_boost@pxrInternal_v0_24_11__pxrReserved__@@YAAEBUregistration@2345@Utype_info@345@@Z) referenced in function "struct pxrInternal_v0_24_11__pxrReserved__::pxr_boost::python::converter::registration const & __cdecl pxrInternal_v0_24_11__pxrReserved__::pxr_boost::python::converter::detail::registry_lookup1<class std::vector<class pxrInternal_v0_24_11__pxrReserved__::TfToken,class std::allocator<class pxrInternal_v0_24_11__pxrReserved__::TfToken> > const volatile &>(struct pxrInternal_v0_24_11__pxrReserved__::pxr_boost::python::type<class std::vector<class pxrInternal_v0_24_11__pxrReserved__::TfToken,class std::allocator<class pxrInternal_v0_24_11__pxrReserved__::TfToken> > const volatile &>)" (??$registry_lookup1@AEDV?$vector@VTfToken@pxrInternal_v0_24_11__pxrReserved__@@V?$allocator@VTfToken@pxrInternal_v0_24_11__pxrReserved__@@@std@@@std@@@detail@converter@python@pxr_boost@pxrInternal_v0_24_11__pxrReserved__@@YAAEBUregistration@1234@U?$type@AEDV?$vector@VTfToken@pxrInternal_v0_24_11__pxrReserved__@@V?$allocator@VTfToken@pxrInternal_v0_24_11__pxrReserved__@@@std@@@std@@@234@@Z)
testUSD.exe : fatal error LNK1120: 1 unresolved externals
ninja: build stopped: subcommand failed.
Here is the CMakeList:
set(MY_USD_BUILD_DIR "C:/Users/******/OneDrive/Documents/DEV/Librairies/USD_Binairies")
# Include directories
include_directories("C:/Users/******/AppData/Local/Programs/Python/Python311/include")
include_directories("C:/Users/******/AppData/Local/Programs/Python/Python311/libs")
include_directories(${MY_USD_BUILD_DIR}/include)
# Link directories
link_directories(${MY_USD_BUILD_DIR}/lib)
link_directories("C:/Users/******/AppData/Local/Programs/Python/Python311/libs")
link_directories("C:/Users/******/AppData/Local/Programs/Python/Python311/include")
# Set environment variables for Python and USD
set(ENV{PYTHONPATH} "C:/Users/******/OneDrive/Documents/DEV/Librairies/USD_Binairies/lib/python")
set(ENV{PATH} "C:/Users/******/OneDrive/Documents/DEV/Librairies/USD_Binairies/lib;C:/Users/matth/OneDrive/Documents/DEV/Librairies/USD_Binairies/bin")
# Find USD and dependencies
find_package(pxr REQUIRED)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
add_compile_definitions(NOMINMAX)
set(CMAKE_VERBOSE_MAKEFILE ON)
add_executable(testUSD main.cpp)
target_link_libraries(testUSD
usd_usdGeom
usd_usd
usd_sdf
usd_vt
usd_tf
usd_usdUtils
usd_boost)
From the changelogs of usd 24.11, pxr_boost::python should be included and I linked usd_boost, so not sure what’s happening.
Thanks a lot for the help