pythonocc-core icon indicating copy to clipboard operation
pythonocc-core copied to clipboard

Build error: Undefined references

Open BorkowskiDominik opened this issue 3 years ago • 2 comments

Hello, I'm trying to build pythonocc from sources and have problem with undefined references errors during RWGltf module build. I have followed instrutions from Install.md, but get following errors:

(...)
CMakeFiles\_RWGltf.dir/objects.a(RWGltfPYTHON_wrap.cxx.obj):RWGltfPYTHON_wrap.cxx:(.rdata$_ZTV18TNaming_UsedShapes[_ZTV18TNaming_UsedShapes]+0xe8): undefined reference to `TDF_Attribute::ExtendedDump(std::ostream&, TDF_IDFilter const&, NCollection_IndexedMap<opencascade::handle<TDF_Attribute>, NCollection_DefaultHasher<opencascade::handle<Standard_Transient> > >&) const'
CMakeFiles\_RWGltf.dir/objects.a(RWGltfPYTHON_wrap.cxx.obj):RWGltfPYTHON_wrap.cxx:(.rdata$_ZTV18TNaming_UsedShapes[_ZTV18TNaming_UsedShapes]+0xf0): undefined reference to `TNaming_UsedShapes::DumpJson(std::ostream&, int) const'
CMakeFiles\_RWGltf.dir/objects.a(RWGltfPYTHON_wrap.cxx.obj):RWGltfPYTHON_wrap.cxx:(.rdata$.refptr._ZTV13TDF_Attribute[.refptr._ZTV13TDF_Attribute]+0x0): undefined reference to `vtable for TDF_Attribute'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[5]: *** [CMakeFiles\_RWGltf.dir\build.make:100: win/bin/Release/_RWGltf.pyd] Error 1
mingw32-make.exe[4]: *** [CMakeFiles\Makefile2:10755: CMakeFiles/_RWGltf.dir/all] Error 2
mingw32-make.exe[3]: *** [Makefile:135: all] Error 2

It occurs at about 70% of total pythonocc so that's probably not problem with paths to occ because build won't go so far. What I'm doing wrong? Can it be quickly fixed or patched?

BorkowskiDominik avatar Sep 28 '22 09:09 BorkowskiDominik

Hello, I am also facing the same issue. Could you please post the solution?

Cheers Prashant

prashant-saxena avatar Jun 09 '23 17:06 prashant-saxena

I suppose, the occt version your are using does not match exactly the pythonocc version.

Make sure, that both match EXACTLY!

In your case, pythonocc tries to wrap a function from occt that is not exported. Therefore, you get undefined references.

rainman110 avatar Jun 09 '23 18:06 rainman110