Points TypedAttributeArray problem

48 views
Skip to first unread message

cgol...@gmail.com

unread,
Mar 9, 2023, 7:42:00 PM3/9/23
to OpenVDB Forum
2nd time around since it seems google groups ate the first.

Win10 / VS2022 / OpenVDB 10.0

I'm trying to use Points and I'm running into the issue of TypedAttributeArray doesn't work on windows.  I tried using other code and went back to the cookbook.  The cookbook code produces the same linking error.

error LNK2001: unresolved external symbol "__declspec(dllimport) protected: __cdecl openvdb::v10_0::points::AttributeArray::AttributeArray(class openvdb::v10_0::points::AttributeArray const &,class tbb::spin_mutex::scoped_lock const &)" (__imp_??0AttributeArray@points@v10_0@openvdb@@IEAA@AEBV0123@AEBVscoped_lock@spin_mutex@tbb@@@Z)

That was from the cookbook's openvdb::points::TypedAttributeArray<float, Codec>::registerType(); line.

The only mention of this problem is Dan talking about it on 4.x and there was no follow-up.  There doesn't seem to be any action on the GIT open issues.

Anyone have any ideas?

edward

unread,
Mar 18, 2023, 4:41:36 PM3/18/23
to OpenVDB Forum
>  Anyone have any ideas?

I just gave the “Hello, World” for OpenVDB Points and the Converting Point Attributes one a quick try and they both worked for me. From linker error, it's saying that it's looking for that method as a shared library import but it's not there. There could be any number of reasons, including:
- The import library for the OpenVDB shared DLL was not linked
- The OpenVDB library being linked in wasn't compiled as a shared library
- OpenVDB and/or the program was compiled with dllimport/dllexport mismatches. For example, OpenVDB needs to compiled with OPENVDB_PRIVATE and OPENVDB_DLL defined. The program using it needs to also have OPENVDB_DLL defined but OPENVDB_PRIVATE *not* defined.

Best regards,
-Edward

cgol...@gmail.com

unread,
Mar 20, 2023, 11:52:01 PM3/20/23
to OpenVDB Forum
It was the way they ported it to vcpkg.   I added AttributeArray.cc to my project and it works.

edward

unread,
Mar 21, 2023, 8:29:46 AM3/21/23
to OpenVDB Forum
Although it's possible, I'd expect that vcpkg to have compiled correctly. I think my first suspicion will be whether you're linking in the correct library provided by vcpkg.

-Edward
Reply all
Reply to author
Forward
0 new messages