tpaviot / pythonocc-core

Python package for 3D geometry CAD/BIM/CAM
GNU Lesser General Public License v3.0
1.39k stars 380 forks source link

Build error: Undefined references #1144

Open BorkowskiDominik opened 2 years ago

BorkowskiDominik commented 2 years ago

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?

prashant-saxena commented 1 year ago

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

Cheers Prashant

rainman110 commented 1 year ago

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.