Pdeploy and MakeNSIS under Ubuntu Linux

I’m currently trying to generate a Windows, standalone, installable build of a prototype, and I’m struggling. Specifically, I’m doing this in Linux via pdeploy’s “-P” option, and seem to be hitting a version mismatch related to the file “libstdc++.so.6”.

Here is the error that I’m getting, with a bit of context on either side:

['/usr/bin/makensis', '-V2', '/tmp/lockpicking.nsi']
/usr/bin/makensis: /home/thaumaturge/.panda3d/hosts/runtime.panda3d.org_0f5faf88846080ae/panda3d/cmu_1.9/linux_amd64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/bin/makensis)
/usr/bin/makensis: /home/thaumaturge/.panda3d/hosts/runtime.panda3d.org_0f5faf88846080ae/panda3d/cmu_1.9/linux_amd64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/bin/makensis)
:Installer(warning): Failure invoking NSIS command.

I’ve encountered this problem before, but I’m not quite confident of how I fixed it then. I think that I locked some package to a specific version–and indeed, I see that I have NSIS locked to version 2.5.

Searching my file system, I see that I do have “libstdc++.so.6”–specifically, the directories “/usr/lib/i386-linux-gnu/” and “/usr/lib/x86_64-linux-gnu/” each have a version of “libstdc++.so.6.0.21”, and a link to it named “libstdc++.so.6”. Using the “strings” command on these (and searching the output via “grep”) indicates that they do offer the required versions of “GLIBCXX”.

However, it seems that when pdeploy is run another version of “libstdc++.so.6” appears in “~/.panda3d/hosts/runtime.panda3d.org_0f5faf88846080ae/panda3d/cmu_1.9/linux_amd64”. I presume that this is the version being used–and “strings” indicates that this one doesn’t offer the required versions!

The above-mention searches of the file system don’t seem to show this version of the file elsewhere, and thus my guess is that something–perhaps NSIS, Panda, or GCC–is downloading it.

I have a suspicion that the issue may be related to the version of GCC installed on my system; I believe that the primary version on my system is 5.4.0. I’ve looked into downgrading this, thinking that an older version might look for older versions of “GLIBCXX”, but it looks as though some significant components depend on it. I believe that I do have an older version installed (4.7), so if GCC is the cause, is there a way of having pdeploy specify the version of GCC to be used?

If not, what might I do about this?

Aha, I’ve fixed it, I believe!

First of all, it seems that “libstdc++.so.6” was indeed being downloaded, by Panda, specifically, and that NSIS was the component looking for a more recent version.

I downgraded NSIS to an earlier version (2.46-7, taken from the repository for Ubuntu “Precise”, to be specific), and that seems to have worked.

Since the installed version of NSIS had been locked, but no other versions were being offered before including the “Precise” repository, I’m guessing that either a system update or my removing old repositories caused it to fall back on what it had available: the newer version. The lock was left in place, however, leading me to mistakenly conclude that I had an appropriate version.

I’m not entirely happy with this solution–it means using an old version of both NSIS and “libstdc++”, the former from a somewhat-old and community-maintained repository, rather than from a more-recent and officially supported one. Nevertheless, it works.

(I intend to leave myself a note regarding this for next time, since I seem to keep bumping into this issue.)