Linking OpenSubdiv to project

33 views
Skip to first unread message

Vojtěch Kratochvil

unread,
Nov 11, 2024, 3:14:08 PM11/11/24
to OpenSubdiv Forum
Hi, I have a total noob question, but I'm slowly loosing my mind, so any help would be truly appreciated.
I am trying to use OpenSubdiv in my Bachelor work but I just can't figure out how to properly link it to my project in Visual studio 2019. Every time I try to build the project I get error messages saying "unresolved external symbol ...". From this I can guess I have made a mistake when linking the library, but I have no idea where or how.
If you would need more details about the project setting or something else, just respond and I will be happy to provide those details.

David G Yu

unread,
Nov 12, 2024, 3:43:01 PM11/12/24
to OpenSubdiv Forum
Hi,

Which symbol is being reported as unresolved? Can you say more about how your project is set up? Is your Visual Studio project setup manually or generated by CMake or similar.

Thanks!
-David

Vojtěch Kratochvil

unread,
Nov 12, 2024, 3:48:10 PM11/12/24
to OpenSubdiv Forum
Solved.

For those, who are are looking at this in the future and are also having this problem.
In my specific case the solution was to match the built OpenSubdiv library type and system architecture. What I mean by that is that if OpenSubdiv library is build in Release mode and on architecture x64 your project will also work only in Release mode and x64 architecture. To use the library in debug mode you must built the library in debug mode and link that to your Debug setting. In visual studio the only difference will be that in Debug settings of project in linker\general\Additional Library Directories you will have path_to_opensubdiv\build\lib\Debug and in Release settings you will have  path_to_opensubdiv\build\lib\Release.

Dne pondělí 11. listopadu 2024 v 21:14:08 UTC+1 uživatel Vojtěch Kratochvil napsal:

David G Yu

unread,
Nov 12, 2024, 7:45:54 PM11/12/24
to OpenSubdiv Forum
Yes, that's correct. Glad to hear that you found the solution.

Thanks!
-David

Reply all
Reply to author
Forward
0 new messages