You are not logged in.
Hi guys, for the first time I decided to use 64bit arch on my machine and so far no complains (I don't think there will ever be). I'm a student of computer engineering and I use C to code some projects but I haven't found a way to compile 32bit programs on my 64bit arch. Everybody says "just add -m32 flag to the compile step" but I think this is not all I have to do (it doesn't work if I just do that).
To prove it I have created a simple "hello world" in C:
#include <stdio.h>
int main(){
printf("Hello, World");
return 0;
}
When I try to compile it, I just run
gcc -m32 hello.c -o hello
But all I get is
In file included from /usr/include/features.h:399:0,
from /usr/include/stdio.h:27,
from test.c:1:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
compile finish
Needless to say it doesn't create the hello executable. Is there some packages I have to install in order to have this happen?
Last edited by xangelux (2012-07-25 00:24:40)
Offline
You'll have to install the multilib packages for gcc, libtool and binutils.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Online
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
Well, you could see that something "-32" is missing so you are searching for 32 bit stuff that is not installed.
There's a tool called pkgfile which searches in the repository database for a file name and tells you which package it is in.
In this case, stubs-32.h
~ % pkgfile stubs-32.h
multilib/lib32-glibc
Maybe another helpful article: https://wiki.archlinux.org/index.php/Ar … ib_Project
฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz
Offline
Thank you guys, that was the answer, I didn't have the multilib repo enabled and so didn't have the gcc and devel for it. It's good to know a new (for me) tool that solves that and more.
This is solved, thanks to both.
Offline