4

I'm building 32 bit boost thread libraries on 32 bit Ubuntu 12.10. When building I get the error /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

I googled the problem and from reading this question it seems I need to install libc6-dev-i386. However, when I run sudo apt-get install libc6-dev-i386 I get:

Package libc6-dev-i386 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libc6-dev-i386' has no installation candidate

Can anyone help me to locate this package?

Edit, more info:

I'm not sure if this is relevant, but uname -m -p -i gives i686 i686 i686.

ls /usr/include/gnu/ gives libc-version.h lib-names.h option-groups.h stubs-64.h stubs.h.

ls /usr/include/i386-linux-gnu/gnu gives libc-version.h lib-names.h option-groups.h stubs-32.h stubs.h.

I added /usr/include/i386-linux-gnu to $PATH but it didn't help, I still get the same error when trying to build the 32 bit boost thread libraries.

More info:

I've now tried this with Ubuntu 12.04 and I'm getting exactly the same behaviour. With this install uname -i gives i386.

1 Answers1

0

This may not be the proper solution but it will download the package for you.

Type "software sources" in the dash, and change your server to "Main server". This is because some (one of which may be yours) do not maintain the package on their servers. Refer to the image below showing the source changed to "Main server". Then do a sudo apt-get update and then sudo apt-get install libc6-dev-i386. Repeating, this is not the proper solution, but will probably download the package for you.

software sources

jobin
  • 27,708
  • Thanks, Jobin. I tried this but unfortunately I'm still getting the same result. – eoinmullan Jan 23 '13 at 14:48
  • Are you sure you did a sudo apt-get update after changing the source? – jobin Jan 23 '13 at 15:59
  • Yes, I did the update. – eoinmullan Jan 23 '13 at 22:12
  • I think, as I'm on a 32 bit OS, that I shouldn't need libc6-dev-i386. I guess the question is then why can the compiler not find stubs-32.h. I've found that if I copy stubs-32.h from /usr/include/i386-linux-gnu/gnu to '/usr/include/gnu` then I can compile the boost thread libraries without a problem. I'd still like to understand why I need to copy that file though? – eoinmullan Jan 23 '13 at 22:17
  • @eoinmullan: Do you mean to say that libc6-dev-i386 is for the 64-bit version? I am not sure but i386 probably means 32 bit. And about the copy that you need to do is may be because /usr/include/i386-linux-gnu/gnu may not be there in the folders that gcc searches to find the header files by default, so if you can manually add that folder, you need not copy it anywhere, I guess. – jobin Jan 24 '13 at 14:03
  • 1
    I figure libc6-dev-i386 is to allow you to compile for 32 bit on a 64 bit machine. That's why I figure I shouldn't need it. Yeah, I guess I could equally have had gcc search in usr/include/i386-linux-gnu/gnu, I expect that would have worked too. But I'd like to understand why stubs-32.h was not in /usr/include/gnu but stubs-64.h was. – eoinmullan Jan 24 '13 at 19:51