Hello, recently I tried to build WebAssembly with VTK 9.6, and successfully built VTK after enabling VTK_WEBASSEMBLY_THREADS=TRUE. However, when I attempted to build WrappedAsyncClipperwithout a main function, an error was thrown. The command I used to build VTK 9.6 is as follows:
It prompts that the main function must be defined, but in many cases we do not need the main function. This example, in particular, demonstrates how to start WebAssembly without using the main function.
Without a verbose log it’s hard to tell. With just that screen capture I can only tell that the linker is expecting the implementation of the main()function somewhere. That is standard C/C++. Now, to build a library without an entry point, you somehow need to explicitly tell the linker to not look for a main() (e.g. via the --no-entry linker flag).
Hello, thank you for your reply.
All the log output is normal. I am compiling the WrappedAsyncClipper example from the official examples, following the steps in the documentation exactly. It can be built and run successfully with VTK 9.5, but this error is thrown during the final linking phase with VTK 9.6.
Thank you for sharing the command line and verbose log. You are correct, we do NOT need to define a main() in that example. I will look into this and get back.