atteneder / DracoUnity

Draco 3D Data Compression Unity Package
Apache License 2.0
245 stars 38 forks source link

iOS compile fails (xcode) with undefined symbols for draco::Encoder #62

Closed camnewnham closed 7 months ago

camnewnham commented 1 year ago

I'm having issues building for iOS:

error: undefined symbol: draco::Encoder::EncodeMeshToBuffer(draco::Mesh const&, draco::EncoderBuffer*)
error: undefined symbol: draco::Encoder::SetEncodingMethod(int)
error: undefined symbol: draco::Encoder::EncodePointCloudToBuffer(draco::PointCloud const&, draco::EncoderBuffer*)
error: undefined symbol: draco::Encoder::SetAttributeQuantization(draco::GeometryAttribute::Type, int)
error: undefined symbol: draco::Encoder::SetSpeedOptions(int, int)
error: undefined symbol: draco::Encoder::Encoder()

The project also includes the decoder which does not seems to have any such issues.

It also seems suspicious that the decoder is 10mb but the encoder is 256kb?

(Note: this is after applying the fix here to ensure the library is included

Perhaps the binary isn't correct?

gabrielgt commented 1 year ago

I am having the same error for Wasm and I think you are right, the size is too small. After adding some source files to the draco_unity_enc_plugin target in the CMakeLists.txt file, it started to work.

I am pretty sure that is not the better solution, but it is a workaround. I hope @atteneder fixes it in a better way. You can see the workaround in this commit: https://github.com/EvergineTeam/draco/commit/adc8866ce142e616412fd6111b6794df031bd6d0

ZelimDamian commented 1 year ago

+1 for the Wasm build failing to link. Multiple errors for multiple symbols like:

Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js: undefined symbol: _ZN5draco7Encoder15SetSpeedOptionsEii (referenced by top-level compiled C/C++ code)
UnityEditor.GenericMenu:CatchMenu (object,string[],int)

@gabrielgt any chance you can share the prebuilt wasm .a files - would be greatly appreciated! Having trouble to build it from sources on my end

ZelimDamian commented 1 year ago

@gabrielgt managed to get Github Actions running by forking and triggering the action myself. It works, thank you!

dganzella commented 12 months ago

K here is the thing, I wanna use the encoder in a swift project. So I tried adding the libdracoenc.a and also found it weird its only 200kb. Yeah it wont compile. THanks @ZelimDamian and @gabrielgt I am learning to use github actions now to build it. I need to get the ios binary

atteneder commented 10 months ago

Heads-up: The library build was to blame. A fix for version 5 is in the making.

atteneder commented 7 months ago

Please transition to Draco for Unity, the successor of this repository/package. That should fix this problem.