I’m wondering if anyone could offer some advice regarding how to properly build a C++ application on Windows that utilises the USD libraries, preferably using Visual Studio. I’ve been trying to get something to build with Visual Studio 2019 but I’m getting nothing but errors, so I’m assuming there’s something I’ve missed (or perhaps I’m taking the wrong approach entirely), but I’m struggling to figure it out. I’m using the OpenUSD 24.05 prebuilt binaries available from Nvidia’s website, in case that’s of any note.
My project is set up as follows:
Empty C++ project in VS
Language standard set to C++20
Additional Include Directories contains the following paths:
C:\OpenUSD\OpenUSD-24.05_prebuilt\include
C:\OpenUSD\OpenUSD-24.05_prebuilt\include\boost-1_78
C:\OpenUSD\OpenUSD-24.05_prebuilt\python\include
Additional Library Directories contains the following paths:
C:\OpenUSD\OpenUSD-24.05_prebuilt\lib
Additional Dependencies contains all of the .lib files within the lib directory (I realise it is probably unnecessary to have every single one, I was just trying whatever I could think of to get something to work).
Buildsystems and package management are a topic that we’ll be discussing in the AOUSD Technical Advisory Committee-- for now, maybe uploading your VS project source files as a GitHub issue might be the way to go, so that someone else can try to reproduce your workflow.
Hi @csmith ,
Seeing the errors you got I am wondering if your main file is not seen as a C file (main.c) instead of a C++ file.
I would recommend using cmake to generate your project using USD, there is also an example using the nvidia libs in GitHub - cpichard/usdtweak: Universal Scene Description standalone editor , (see Using NVidia’s USD build) although it dates a little bit, it might be helpful. The CMakeLists.txt in this project file can be used as a template.