unity-flex-ui icon indicating copy to clipboard operation
unity-flex-ui copied to clipboard

Build error in Unity 6000 "undefined symbol"

Open RobTranquillo opened this issue 1 year ago • 1 comments
trafficstars

Hello, today I found your package and loved it from the first moment. I have created 2 layout mockups with it in no time. Feels great compared to Unity's layout disaster. But unfortunately the build pipeline fails in WebGL and I have no idea why. I have filed an issue at Unitys forum but maybe you can help.

Thanks a lot and have a nice day

RobTranquillo avatar Aug 08 '24 18:08 RobTranquillo

Hey @RobTranquillo, thanks for the report. I'm glad you liked the package ^^

So, you say you have an "undefined symbol" error, but in the forum there is nothing with this error written in it. Can you post here the whole error message? Or at least which symbols are undefined in your build. Maybe Unity 6 needs WebGL native plugins to be in .a and dropped support for .bc files?

gilzoide avatar Aug 11 '24 12:08 gilzoide

@gilzoide yes your package is great but I have that same undefined error on WebGL build. Can you please take a look? Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output: wasm-ld: error: Library/PackageCache/com.gilzoide.flex-ui/Plugins/build/webgl/libflex-ui.a(flex-ui-amalgamated.o~): undefined symbol: std::__2::__vector_base_common<true>::__throw_length_error() const wasm-ld: error: Library/PackageCache/com.gilzoide.flex-ui/Plugins/build/webgl/libflex-ui.a(flex-ui-amalgamated.o~): undefined symbol: std::__2::__vector_base_common<true>::__throw_out_of_range() const emcc: error: 'C:/Unity/6000.0.25f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/llvm\wasm-ld.exe

vitalykr avatar Feb 28 '25 15:02 vitalykr

Hey @vitalykr, thanks for adding more information to the issue. You too are using Unity 6, correct? I'll try reproducing here.

gilzoide avatar Mar 01 '25 09:03 gilzoide

Ok, I can confirm the problem occurs in Unity 6 and I have been able to compile the plugin in a way that builds correctly for Web platform in both Unity 2022.3 and Unity 6. I'll open a PR soon with the fix.

gilzoide avatar Mar 01 '25 10:03 gilzoide

Hey @vitalykr, the fix is in branch bugfix/unity-6-web, could you please test it and let me know if the problem is fixed?

gilzoide avatar Mar 01 '25 10:03 gilzoide

@gilzoide thanks for checking, but I still get those errors on Unity 6: wasm-ld: error: Library/PackageCache/com.gilzoide.flex-ui/Plugins/build/webgl/libflex-ui.a(flex-ui-amalgamated.o~): undefined symbol: std::__2::__vector_base_common<true>::__throw_length_error() const wasm-ld: error: Library/PackageCache/com.gilzoide.flex-ui/Plugins/build/webgl/libflex-ui.a(flex-ui-amalgamated.o~): undefined symbol: std::__2::__vector_base_common<true>::__throw_out_of_range() const I also tried cleaning up Library folder and this still does not compile

vitalykr avatar Mar 02 '25 08:03 vitalykr

@vitalykr weird, I built the new library without C++ exceptions, there are no __throw_length_error and __throw_out_of_range undefined symbols in it anymore. Are you sure you are using the new branch bugfix/unity-6-web, which contains the fix? I haven't merged it yet.

gilzoide avatar Mar 02 '25 10:03 gilzoide

@gilzoide I just tested it again for some reason the Unity did not react to "https://github.example.com/myuser/myrepository.git#my-branch" instead I have downloaded the package separately and pulled the branch. Now it seems to compile for me, so I assume you may merge this into main, many thanks for a quick fix!

vitalykr avatar Mar 02 '25 18:03 vitalykr

All right, thanks for confirming that it works! I merged the fix and released version 1.2.2 with it. Cheers \o/

gilzoide avatar Mar 02 '25 19:03 gilzoide