0

Trying to build a 32-bit app on kubuntu 18.04. I've got it to the point where I can use -m32 to compile my code in 32-bit mode, and am able to build a trivial app (once I installed multilibs). But now I'm trying to build an app that uses -lcurses, and ld is complaining about an incompatible X86-64 version of -ltinfo (which I assume is the 'terminfo' library - and is called in by my invoking the curses library). Specifically:

/usr/bin/ld: skipping incompatible //usr/lib/x86_64-linux-gnu/libtinfo.so when searching for -ltinfo

I've got cc -m32 on my final build line, and it's not complaining about any other libraries.

For what it's worth, if I go with the system defaults and allow my app to build as a 64-bit binary, everything builds - so I'm assuming I'm asking for all the right libraries, etc. It's just that the app doesn't work right as a 64-bit app, and before I go down the path of figuring out why that is, I thought I'd try to build it as a 32-bit app - which worked 20 years ago when I did my first 'proof of concept' linux build for this app ;-)

Is there some other way to invoke the 'ld' command to get the proper 32-bit libraries to load? Or do I have to install yet another 32-bit library package for -lcurses to work in 32-bit mode?

  • My understanding of multiarch in regard to the build process is rudimentary, but afaik it is only the headers that are common - you *will* generally need to install the `:i386` versions of any actual libraries required. In fact, it looks like `libncurses5:i386` depends on `libtinfo5:i386` so I'm surprised the latter wasn't installed when you installed the former. – steeldriver May 05 '20 at 15:07
  • It *is* there. Not sure why it isn't picked up. $ locate libtinfo|grep i386 /lib/i386-linux-gnu/libtinfo.so.5 /lib/i386-linux-gnu/libtinfo.so.5.9 /var/lib/dpkg/info/libtinfo5:i386.list /var/lib/dpkg/info/libtinfo5:i386.md5sums /var/lib/dpkg/info/libtinfo5:i386.shlibs /var/lib/dpkg/info/libtinfo5:i386.symbols /var/lib/dpkg/info/libtinfo5:i386.triggers I've given up on trying to build this stuff in 32-bit mode at this point. Gonna bite the bullet and go 64-bit, dealing with a bunch of 'pointer and int are not the same size' problems - but such is sloppily written code... – littlenoodles May 06 '20 at 13:29
  • OK so it looks like you need to install the `-dev:i386` package(s) and apparently can do so without conflict. What's missing is the symlink `/usr/lib/i386-linux-gnu/libtinfo.so -> /lib/i386-linux-gnu/libtinfo.so.5` which installation of the architecture dependent -dev package creates. You may need to do the same for `libncurses5-dev:i386`. I suggest you try first with the `--dry-run` apt flag to make sure there are no conflicts on your particular system. – steeldriver May 06 '20 at 13:53
  • Hmmm. I thought I *had* installed the 386 dev stuff, and I *do* have a lot of stuff in /usr/lib/i386-linux-gnu. But libtinfo is *not* there - even though 'locate libtinfo' said it was. Perhaps it was there the last time locate updated its database, but was subsequently uninstalled. Thanks. – littlenoodles May 07 '20 at 17:58

0 Answers0