Pcbnew does not start - MakeShape symbol not found

I think what’s happening is you have another opencascade library which happens to be the same version but was built slightly differently, and it’s pulled in by another CAD program. I seem to remember that FreeCAD and KiCad have problems co-existing. Even though you may be using an Appimage for FreeCAD, do you have any leftover traces of an attempted native install? Or some other CAD program that uses opencascade?

I think you are right. But I still don’t get it, how two pairs of binary files (executable->library) can be exactly the same on two installations, and still on one installation the executable claims that it cannot find a symbol.

I don’t like what you say about FreeCad<->Kicad coexistence problems. That would be a bummer! I never had issues as so far. But ok - I think I have to get rid of all that occt stuff. I have to admit that I have about half a dozen different appimages of Freecad, both vanilla and Link Branch on my system. And I may also have installed FreeCAD in ancient times… Thanks for the hint!

If installing KiCad from PPA, you also have to install FreeCAD from PPA, because they both use the same OpenCascade version which is newer than is provided by upstream Ubuntu.

This issue seems like an old version of OpenCascade is left on your system for some reason.

Ok, I’ll try that.

Oh. BTW, about the files not coming from a debian package in the above post - ok, at least this mystery is solved :slight_smile:

/lib is a symlink to /usr/lib on ubuntu. So if I do a dpkg -L on /lib/… it doesn’t find a match, but it does for /usr/lib/…
The file comes from libocct-modeling-algorithms-7.6:amd64

So let’s see if I have some strange leftovers from a FreeCAD somewhere. Thank you very much for your hints!

find /lib/x86_64-linux-gnu/ -name "libTK*.so" -print -exec sh -c "readelf -W -s {} | grep _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange" \;

That symbol should be defined in /lib/x86_64-linux-gnu/libTKTopAlgo.so

/lib/x86_64-linux-gnu/libTKRWMesh.so
/lib/x86_64-linux-gnu/libTKXMesh.so
/lib/x86_64-linux-gnu/libTKIGES.so
/lib/x86_64-linux-gnu/libTKMath.so
/lib/x86_64-linux-gnu/libTKMesh.so
   283: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKXDEDRAW.so
/lib/x86_64-linux-gnu/libTKBinTObj.so
/lib/x86_64-linux-gnu/libTKShHealing.so
   821: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKQADraw.so
  1621: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKXCAF.so
/lib/x86_64-linux-gnu/libTKDraw.so
/lib/x86_64-linux-gnu/libTKXmlXCAF.so
/lib/x86_64-linux-gnu/libTKXmlL.so
/lib/x86_64-linux-gnu/libTKG3d.so
/lib/x86_64-linux-gnu/libTKStdL.so
/lib/x86_64-linux-gnu/libTKTopTest.so
  1922: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKG2d.so
/lib/x86_64-linux-gnu/libTKCAF.so
   327: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKDCAF.so
   913: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKMeshVS.so
/lib/x86_64-linux-gnu/libTKStd.so
/lib/x86_64-linux-gnu/libTKHLR.so
/lib/x86_64-linux-gnu/libTKSTEP209.so
/lib/x86_64-linux-gnu/libTKGeomBase.so
/lib/x86_64-linux-gnu/libTKTObj.so
/lib/x86_64-linux-gnu/libTKFillet.so
   841: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKLCAF.so
/lib/x86_64-linux-gnu/libTKBin.so
/lib/x86_64-linux-gnu/libTKVRML.so
/lib/x86_64-linux-gnu/libTKSTEPBase.so
/lib/x86_64-linux-gnu/libTKXml.so
/lib/x86_64-linux-gnu/libTKTObjDRAW.so
/lib/x86_64-linux-gnu/libTKBinL.so
/lib/x86_64-linux-gnu/libTKXSDRAW.so
/lib/x86_64-linux-gnu/libTKOpenGlTest.so
/lib/x86_64-linux-gnu/libTKBRep.so
/lib/x86_64-linux-gnu/libTKFeat.so
   561: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKSTEP.so
  5041: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKCDF.so
/lib/x86_64-linux-gnu/libTKOffset.so
   968: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKernel.so
/lib/x86_64-linux-gnu/libTKOpenGl.so
/lib/x86_64-linux-gnu/libTKXmlTObj.so
/lib/x86_64-linux-gnu/libTKSTL.so
    50: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKV3d.so
   857: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKVCAF.so
/lib/x86_64-linux-gnu/libTKPrim.so
    84: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKXDESTEP.so
/lib/x86_64-linux-gnu/libTKBool.so
  1089: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKXDEIGES.so
/lib/x86_64-linux-gnu/libTKTopAlgo.so
  1214: 0000000000180f10     5 FUNC    GLOBAL DEFAULT   14 _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKBinXCAF.so
/lib/x86_64-linux-gnu/libTKGeomAlgo.so
/lib/x86_64-linux-gnu/libTKSTEPAttr.so
/lib/x86_64-linux-gnu/libTKService.so
/lib/x86_64-linux-gnu/libTKXSBase.so
/lib/x86_64-linux-gnu/libTKViewerTest.so
/lib/x86_64-linux-gnu/libTKBO.so
   686: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange

Yes, I have that:

/lib/x86_64-linux-gnu/libTKSTEPAttr.so.7.6.3
/lib/x86_64-linux-gnu/libTKXDEDRAW.so.7.6.3
/lib/x86_64-linux-gnu/libTKTopAlgo.so
  1214: 0000000000180f10     5 FUNC    GLOBAL DEFAULT   14 _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange

Meanwhile I have apt removed libocct*, (which wiped kicad, too), did an autoremove, installed again - same.
Apt policy on all libocct* packages gives me exactly the same on the host installation and the VM installation, including versions and ppa (all from KiCad-8.0). And still, one works, the other not :frowning:

Try:
sudo apt install libtree
libtree -p /usr/bin/_pcbnew.kiface

Is /lib/x86_64-linux-gnu/libTKTopAlgo.so.7 in the tree?

Also what does this say?

ls -la /lib/x86_64-linux-gnu/libTKTopAlgo.so* /lib/x86_64-linux-gnu/libTKBO.so* /lib/x86_64-linux-gnu/libTKPrim.so*

Yes, I have it, mentioned 15 times. But not in that particular chain seen on your screen-shot.
If I interpret the output correctly, I don’t see libTKPrim.so being dependent on libTKTopAlgo.so

ls -la /lib/x86_64-linux-gnu/libTKTopAlgo.so* /lib/x86_64-linux-gnu/libTKBO.so* /lib/x86_64-linux-gnu/libTKPrim.so*

lrwxrwxrwx 1 root root      16 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKBO.so.7 -> libTKBO.so.7.6.3
-rw-r--r-- 1 root root 1927520 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKBO.so.7.6.3
lrwxrwxrwx 1 root root      18 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKPrim.so.7 -> libTKPrim.so.7.6.3
-rw-r--r-- 1 root root  358744 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKPrim.so.7.6.3
lrwxrwxrwx 1 root root      17 Mai 20 17:39 /lib/x86_64-linux-gnu/libTKTopAlgo.so -> libTKTopAlgo.so.7
lrwxrwxrwx 1 root root      21 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKTopAlgo.so.7 -> libTKTopAlgo.so.7.6.3
-rw-r--r-- 1 root root 2472288 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKTopAlgo.so.7.6.3

At least I now know a new tool :smiley:

Can you share the whole output?

libtree -p /usr/bin/_pcbnew.kiface > tree.txt

I cannot upload files (new user). But here’s a google drive link to it:

You have a mix of /usr/local and system libs


tree.txt (39.8 KB)

ldd /usr/bin/_pcbnew.kiface | grep TK
would’ve also revealed this.

uh - ouch! And yes, finally I see something DIFFERENT between the working installation and the one that doesn’t work! Ok… I have to settle that and then try to clean that up :slight_smile: THANKS A LOT!

1 Like

IT WORKS!

Thanks A LOT guys! :smiley:

After cleaning up my mess in the ld.conf files I still was not yet there. But then, thanks to libtree, chsum, dpkg -S and apt policy, it was easy to follow all the discrepancies. Some wxWidget libs were also coming from wrong ppa’s.

But, just for the record:


`Failed to load shared library '/usr/bin/_pcbnew.kiface': 
/lib/x86_64-linux-gnu/libTKBO.so.7: undefined symbol: 
_ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange`

This was just lying! Somehow it took the lib from /usr/local, but still claimed that it did not find the symbol in the system lib. Or even: Could it be that when there is a problem downstream a library call, the error message is just “undefined symbol”?

Again: THANKS A LOT for all your help!

/usr/bin/_pcbnew.kiface needs libTKBO.so.7 (you can see it in readelf -d)

/lib/x86_64-linux-gnu/libTKBO.so.7 (system) was loaded because apparently there was no /usr/local/lib/libTKBO.so.7

/lib/x86_64-linux-gnu/libTKBO.so.7 needs libTKTopAlgo.so.7

Since /usr/local/lib path is before others in /etc/ld.so.conf*,
/usr/local/lib/libTKTopAlgo.so.7 was loaded, which apparently doesn’t have the correct symbol.

So the error message makes sense.

Aaaaah, ok…

I interpreted

Failed to load shared library '/usr/bin/_pcbnew.kiface': 
/lib/x86_64-linux-gnu/libTKBO.so.7: undefined symbol: 
_ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange

as:
_pcbnew.kiface needs _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange from /lib/x86_64-linux-gnu/libTKBO.so.7 but cannot find it.”

But if I understand you correctly, what the message meant was:
“In _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange from /lib/x86_64-linux-gnu/libTKBO.so.7, loaded by _pcbnew.kiface, there was an issue: missing symbol”

/lib/x86_64-linux-gnu/libTKBO.so.7 has an undefined symbol _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange (some code in boolean operations uses BRepBuilderAPI_MakeShape::Build(Message_ProgressRange const&)).

When the dynamic loader loads libTKBO.so.7’s dependency libTKTopAlgo.so.7, it should have resolved that symbol (but the loader doesn’t know that)

Just in case somebody has a similar problem in Ubuntu 24.04 (noble) - the kicad package from the KiCad Ubuntu repository depends on libocct-modeling-algorithms-7.6, whose description says

  This package contains the following shared libraries:
    TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat
    TKMesh TKXMesh TKShHealing

However, this package doesn’t actually contain any shared library files:

$ dpkg -L libocct-modeling-algorithms-7.6
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/share
/usr/share/doc
/usr/share/doc/libocct-modeling-algorithms-7.6
/usr/share/doc/libocct-modeling-algorithms-7.6/changelog.Debian.gz
/usr/share/doc/libocct-modeling-algorithms-7.6/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libocct-modeling-algorithms-7.6

The solution was to install the package libocct-modeling-algorithms-7.6t64 from the standard Ubuntu repository.

I see the shared libs in jammy version from kicad-8.0-releases ppa:

$ dpkg -L libocct-modeling-algorithms-7.6
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libTKBO.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKBool.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKFeat.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKFillet.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKGeomAlgo.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKHLR.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKMesh.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKOffset.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKPrim.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKShHealing.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKTopAlgo.so.7.6.3
/usr/lib/x86_64-linux-gnu/libTKXMesh.so.7.6.3
/usr/share
/usr/share/doc
/usr/share/doc/libocct-modeling-algorithms-7.6
/usr/share/doc/libocct-modeling-algorithms-7.6/changelog.Debian.gz
/usr/share/doc/libocct-modeling-algorithms-7.6/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libocct-modeling-algorithms-7.6
/usr/lib/x86_64-linux-gnu/libTKBO.so.7
/usr/lib/x86_64-linux-gnu/libTKBool.so.7
/usr/lib/x86_64-linux-gnu/libTKFeat.so.7
/usr/lib/x86_64-linux-gnu/libTKFillet.so.7
/usr/lib/x86_64-linux-gnu/libTKGeomAlgo.so.7
/usr/lib/x86_64-linux-gnu/libTKHLR.so.7
/usr/lib/x86_64-linux-gnu/libTKMesh.so.7
/usr/lib/x86_64-linux-gnu/libTKOffset.so.7
/usr/lib/x86_64-linux-gnu/libTKPrim.so.7
/usr/lib/x86_64-linux-gnu/libTKShHealing.so.7
/usr/lib/x86_64-linux-gnu/libTKTopAlgo.so.7
/usr/lib/x86_64-linux-gnu/libTKXMesh.so.7
$ apt show libocct-modeling-algorithms-7.6
Package: libocct-modeling-algorithms-7.6
Version: 1:7.6.3+dfsg1-8~ubuntu22.04.1
Priority: optional
Section: libs
Source: opencascade
Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Installed-Size: 21,8 MB
Depends: libc6 (>= 2.33), libgcc-s1 (>= 3.3.1), libocct-foundation-7.6 (>= 1:7.6.3+dfsg1), libocct-modeling-data-7.6 (>= 1:7.6.3+dfsg1), libstdc++6 (>= 11)
Breaks: libocct-modeling-algorithms-7.4, libocct-modeling-algorithms-7.5
Replaces: libocct-modeling-algorithms-7.4, libocct-modeling-algorithms-7.5
Download-Size: 7 109 kB
APT-Manual-Installed: yes
APT-Sources: https://ppa.launchpadcontent.net/kicad/kicad-8.0-releases/ubuntu jammy/main amd64 Packages
Description: Open CASCADE Technology geometrical & topological algorithms module
 Open CASCADE Technology is a suite for 3D surface and solid modeling,
 visualization, data exchange and rapid application development.  It is an
 excellent platform for development of numerical simulation software including
 CAD/CAM/CAE, AEC and GIS, as well as PDM applications.
 .
 This package contains the following shared libraries:
 TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat
 TKMesh TKXMesh TKShHealing

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.