Warning undefined symbol vtkBalloonRepresentation ScaleImage

I finally manage to build vtk in wasm with QT and reached the linking stage.
However, I am getting this warning (and not a linker error) during build

warning: undefined symbol: _ZN24vtkBalloonRepresentation10ScaleImageEPdd (referenced by top-level compiled C/C++ code)
warning: undefined symbol: _ZN24vtkBalloonRepresentation15AdjustImageSizeEPd (referenced by top-level compiled C/C++ code)

Bellow are the libraries I linked during build

 -lvtksys-9.3 \
    -lvtkRenderingVolume-9.3    \
    -lvtkRenderingVolumeOpenGL2-9.3 \
    -lvtkRenderingFreeType-9.3 \
    -lvtkInteractionStyle-9.3 \
    -lvtkCommonCore-9.3 \
    -lvtkCommonDataModel-9.3 \
    -lvtkCommonExecutionModel-9.3 \
    -lvtkCommonMath-9.3 \
    -lvtkCommonTransforms-9.3 \
    -lvtkCommonComputationalGeometry-9.3 \
    -lvtkFiltersCore-9.3 \
    -lvtkFiltersGeneral-9.3 \
    -lvtkFiltersExtraction-9.3 \
    -lvtkFiltersGeometry-9.3 \
    -lvtkFiltersModeling-9.3 \
    -lvtkFiltersSources-9.3 \
    -lvtkImagingHybrid-9.3 \
    -lvtkRenderingAnnotation-9.3 \
    -lvtkRenderingCore-9.3 \
    -lvtkRenderingOpenGL2-9.3 \
    -lvtkIOCore-9.3 \
    -lvtkIOGeometry-9.3 \
    -lvtkIOImage-9.3 \
    -lvtkIOLegacy-9.3 \
    -lvtkIOXML-9.3 \
    -lvtkIOPLY-9.3 \
    -lvtkInteractionWidgets-9.3 \
    -lvtkCommonMisc-9.3 \
    -lvtkIOXMLParser-9.3   \
    -lvtkpng-9.3     \
    -lvtkCommonSystem-9.3 \
    -lvtkCommonColor-9.3 \
    -lvtkzlib-9.3   \
    -lvtkjpeg-9.3   \
    -lvtkexpat-9.3  \
    -lvtkRenderingHyperTreeGrid-9.3    \
    -lvtkpugixml-9.3    \
    -lvtkImagingCore-9.3  \
    -lvtkFiltersHyperTree-9.3    \
    -lvtkFiltersHybrid-9.3	\
    -lvtkfmt-9.3		\
    -lvtkdoubleconversion-9.3	\
    -lvtklz4-9.3			\
    -lvtkRenderingUI-9.3		\
    -lvtklzma-9.3			\

Im not sure what library to link to resolve that warning, and I am confuse why is it a warning instead of a link error?

I don’t have a local installation of the VTK source, but I used to use this Python script with OpenCV to find missing symbols, and what library they were in. Perhaps you could adapt it to your purpose? You run it like findmissing.py <yourmangledsymbol>.

#!/usr/bin/env python3

import glob, subprocess, sys

def unmangle(s):
    return subprocess.check_output(["c++filt", mangled_name]).strip()

def is_cpp_name(s):
    return s.find("::") != -1

if __name__ == "__main__":
    shared_objects = glob.glob("*.so")
    mangled_name = sys.argv[1]
    if is_cpp_name(mangled_name):
        nm_flags = "-gDC"
        nm_flags = "-gD"

    print("demangled: {}".format(unmangle(mangled_name)))
    print("perhaps try linking against:")
    for soname in shared_objects:
        output = subprocess.check_output(["nm", nm_flags , soname])
        for thing in output.decode("utf-8").splitlines():
        if mangled_name in thing [19:].strip():

The problem is that the source file has inline on these methods. Can you try this patch?


yeah I think this solved the problem, thanks!