[SOLVED]Compiling 32bit C programs on a 64bit arch

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)

xangelux wrote:/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

Similar Messages

  • [SOLVED] Compile 32bit Wine in x64 without chroot?

    I was wondering if it's possible. Due to winetricks not working with x64 wine, I wanted to do a compile of 32-bit Wine without chroot. I need to apply patches, otherwise I'd just use pacman. I've looked but pretty much all topics I've found that are related are before Multilib was added to Arch and all require chroot. Thanks for any help.
    -- Edit --
    Solved it by just getting multilib gcc, and downloading all the missing dependencies that caused warnings after ./configure with x32 wine
    Last edited by Citric (2012-05-14 02:57:46)

    Citric wrote:
    tommis wrote:
    You don't recompile new wine you use 32 bit wineprefix.
    env WINEARCH=win32 WINEPREFIX=~/where/you/want/your/wineprefix/to/be winecfg
    See: https://wiki.archlinux.org/index.php/Wine
    This is for precompiled from pacman. I have to do a fresh compile to be able to apply patches that will fixes games/software for myself, which usually requires a chroot to compile it in 32-bit, therefore pacman isn't an option.
    it doesn't require a 32-bit chroot. that is only 1 of 2 options;
    https://wiki.archlinux.org/index.php/Ar … _Arch64.3F
    You can use a chroot if you want to, or have good reason to... but myself -> i run a multilib system and i compile wine on every update (i just compiled 1.5.4 yesterday). I only use 32bit apps in wine, as well via my 32bit prefix.
    If you decide to go the 'multilib' route, you could use package management in arch to compile/install wine ... there are a couple of patched versions of wine in the AUR, that you could use as a template. just download the tarball, extract it and modify it to use your patches / suit your needs, add your patches to the directory, fix checksums, etc and voila
    patched versions of wine in AUR;
    https://aur.archlinux.org/packages.php?ID=40169
    https://aur.archlinux.org/packages.php?ID=52143
    there is one or two others, but they are very similar. either could work as a good template.
    ...then anytime you want to update wine, you just cd into the pkgbuild's directory and makepkg -si (you may have to edit the pkgver)... (you can also automate all of this too, i just don't have a link(s) to the archwiki on this, off hand.
    anyway, it basically comes down to either having a 32bit chroot, or running a multlib system.
    cheerz
    Last edited by triplesquarednine (2012-05-14 17:46:58)

  • [solved] 32bit Sun JVM on 64bit Arch

    Hello,
    Does anybody know an easy way to install 32bit Sun's JVM on 64bit Archlinux?
    I know that I can download installation script from Sun's website but I want to make this JVM available to all users and install it in some clean way --- making somehow Arch package from the Sun's installer would be nice.
    Maybe I could use the ABS tree, there is a JRE and JDK there, but I don't know how to compile them to 32bit versions and make x86_64 packages of them.
    THX in advance.
    Last edited by kryr (2008-06-19 22:00:51)

    Yes - just use my package here.  I've  used it for quite some time now, and it works perfectly.  One small note - it's expected to be the only JDK on your system (no parallel 64-bit version).  I did it that way because I haven't had the time to make something like Gentoo's 'java-config' or 'eselect' utilities.  However, it does work with everything, even Eclipse.
    Good luck!

  • QT 32bit on 64bit arch

    I want to develope a QT based application for android using a 64bit archlinux. I also want to test it on 64bit archlinux. The problem is, that i have to use a library which i have for android and for 32bit linux only. So i need a 32bit QT for 64bit archlinux to build and test the application on my pc.
    I have installed QT for android from aur, but i can't find it for 32bit on 64bit archlinux.
    (Because i want to develope an android application i need a QT version >=5.1)
    I tried to compile Qt from source with this configuration
    ./configure -platform linux-g++-64 -xplatform linux-g++-32
    But it doesn't work. I also tried to export this before compiling:
    CFLAGS = -m32
    CXXFLAGS = -m32
    LFLAGS = -m32
    But it doesn't helped. Qtcreator says, that i have a 32bit compiler(gcc) so that should not be the problem.
    I tried a chroot as well like this https://wiki.archlinux.org/index.php/In … _in_Arch64 , but when i try to install qt i get the error that it is for the wrong Architekture. I can't install some packages. Some other are working.
    I just started learning c++ and QT(but i have experience with c and i'm a java developer). So is there a way to get this working? Or do i have to install a 32bit archlinux for this?
    Thanks for reply
    Last edited by Algor88 (2013-04-20 13:22:27)

    I had a problem compiling my qt programs until I found this http://www.spinics.net/lists/gcchelp/msg36767.html which basically tells you to install gcc-multilib. If you don't have gcc-multilib installed it probably just ignores the -m32 flag.

  • It only uses 32bit, and my computer needs 64bit.   Please help.

    I am a non profit.  I ordered Photo shop Elements12 for PC  for my office.  It is a download only.  It doesn't dowload on my computer.  It only uses 32bit, and my computer needs 64bit.   Please help. The Adobe photoshop elements 12 is useless to me.  I can't seem to get anyone at Techsoup to help and trying to get Adobe to help is runaround.  What should I do to get it to run on my computer.  Please someone in the forum let me know how switch out the download for the correct one.

    64-bit windows can run 32-bit applications just fine and always has.  They are just limited to a small amount of memory.   If something isn’t working it’s likely another problem like an incomplete download or trying to install the Mac version on a PC or something like that.
    You can try downloading and installing from the PSE12 link, here, to see if it works any better:
    http://www.adobe.com/downloads/other-downloads.html
    If you can’t get things to work, then please post a screenshot of the error and a description of what you’re trying to do that lead to the error.
    Also the term “downloading” refers to transferring a file from a remote server, across the internet, to your local computer.   The term “install” means running the program that was downloaded on your local computer to put the working program on your computer that you can run.
    It would be helpful to know if your saying that the actual transfer across the internet part isn’t working, or if that part seemed to work, but when you run that installer program you’re seeing an error.

  • Error when compiling the upload program (Message no. RSAR233)

    Hello,
    I tried to upload data from a flatfile but I did modified the Comm.Structure, Trans.Structure and Transfer Rules.
    After <u><b>activating</b></u> the all changes, I check data from InfoPackage by previewing it. Unfortunately, I got the follow messages from the popup window:
    Error 8 when compiling the upload program: row
    227, message: Data type /BIC/CCABTWJI_STK01 was
    found in a newer
    I got this kind of problems many times. I solved it by create a new infosource and everything again. I don't think it's good idea to do this way.
    Any better solution would be sincerely appreciated?
    -WJ-

    Another solution:
    go out the transaction RSA1 ans return to the transaction RSA1 again.
    This would help for me without restarting anything.
    Thank you very much for all suggestion.
    -WJ-

  • Error 8 when compiling the upload program: row 436

    Hi all,
    pls let me know how to solve this error
    Error 8 when compiling the upload program: row 436, message: A newer version of data type /BIC/B0000582000 was
    Thanks
    Prashant

    Hello SAP gurus.
    I know it's a very long time the question was asked, but who cares if it can someday help somebody?
    So i just faced the same issue, the solution was sample, i relaunch RSA1 and the problem was solved.
    Hope i would be helpful
    Salah

  • [SOLVED] Building 32bit gtk2 theme engines for binary 32bit apps

    Hello, I love the nimbus theme and have installed it from the AUR.
    Sadly, there are applications like acroread, foxitreader etc. that won't load the engine and use a nasty default saying
    Gtk-Message: Failed to load module "/opt/lib32/usr/lib/gtk-2.0/modules/libgnomebreakpad.so": /opt/lib32/usr/lib/gtk-2.0/modules/libgnomebreakpad.so: cannot open shared object file: No such file or directory
    (FoxitReader:10389): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libnimbus.so: wrong ELF class: ELFCLASS64
    (FoxitReader:10389): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libnimbus.so: wrong ELF class: ELFCLASS64
    Gtk-Message: Failed to load module "canberra-gtk-module": /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so: wrong ELF class: ELFCLASS64
    Gtk-Message: Failed to load module "gnomebreakpad": /usr/lib/gtk-2.0/modules/libgnomebreakpad.so: wrong ELF class: ELFCLASS64
    As far as I understand, especially since using the Clearlooks engine, everything works as intended. Clearlooks however has a 32bit version in
    /opt/lib32/usr/lib/gtk-2.0/2.10.0/engines
    I want to be able to use the nimbus theme everywhere. However I can't figure out how to make a 32bit binary with the provided gcc and moreover, where to put the resulting files.
    Please help, it really murders consistency and renders 64bit Arch a real pain in the a**. I know about the pure 64bit stance, but honestly, there are some apps that are simply only 32bit.
    Last edited by clamshell (2009-08-16 18:58:20)

    Okay so... status update.
    I really wanted to make Acrobat Reader work with the Nimbus theme.
    I used yaourt in a hastily set-up chroot and build the package from the aur (fortunately you can cancel the actual installation). I then copied the pkg.tar.gz to my desktop.
    The 32bit Gtk themes are installed in:
    /opt/lib32/usr/lib/gtk-2.0/2.10.0/engines
    I used the line from the AUR pkgbuild:
    cp -rPf "$srcdir/usr/lib/gtk-2.0/2.10.0/engines" "$pkgdir/opt/lib32/usr/lib/gtk-2.0/2.10.0"
    So, on my system:
    cp -rPf /home/dan/Desktop/usr/lib/gtk-2.0/2.10.0/engines/ /opt/lib32/usr/lib/gtk-2.0/2.10.0/
    after having unzipped the package - nimbus-0.1.2-2-i686.pkg.tar.gz.
    The -r option means recursive, the -P option preserver permissions and the -f option checks if the destination file can be opened and if not, deletes it and recopies.
    You will notice that in the above directory, you'll find 2 files - libnimbus.a and libnimbus.so
    All the other themes only have the shared object file and the .a file is an archive as far as nautilus is concerned (can't open it, need ar apparently). Everything seems to work if you delete the .a file. I am not sure if the file is only appears with this theme, or with any theme installed this way.
    So, finally, it worked. Acrobat opened and used the new theme.
    But...
    Vertical scrollbar problem
    by LucasVieites on: May 4 2009     
    Hi, the vertical scrollbars overlap when viewing large documents. This screenshot is from Adobe Reader opening a 600 page document: http://www.codexion.com/files/pdf_reader_nimbus.png
    I hope this can be solved.
    from the gnome-look.org site.
    So, it's bugged. The theme. Anyway, the tutorial should work just fine on any non-standard theme you need to use in 32bit apps. It could probably be automated a bit more and perhaps with a multilib gcc, you could do it some other way.
    The point is you really need the libnimbus.so. The shared resources are architecture independent and the standard path will work.
    Oh and I've given up on the nimbus theme itself actually. Care to suggest any good gtk theme?

  • PLEASE HELP!!  HOW DO YOU COMPILE THE HELLO PROGRAM?

    Hi everybody,
    I just install j2sdk1.4.1_01 on my RH 8. And it's install under the directory /usr/j2sdk1.4.1_01 Now, I was compiling the hello program under /home/JAVATEST
    and it gives me the following error
    Exception in thread "main" java.lang.NoClassDefFoundError: hello
    Could anyone please help me on how to solve this problem. I have try to setup CLASSPATH under .bash_profile as this:
    JAVA_HOME=/usr/j2sdk1.4.1_01
    export JAVA_HOME
    CLASSPATH=./:$JAVA_HOME/lib
    export CLASSPATH
    and still. It would still give me the error. Would anybody please help me on it?? Thanks. I need to do my homework soon. ^<^ thanks

    I think it's your program.
    it's I believe like this isn't it?
    // Put this in a file called hello.java
    public class hello
        public static void main(String args[])
            System.out.println("Hello world!");
        }Try compiling this with the following command : @home>javac hello.java
    then run the command with : @home>java hello
    It should run just like that

  • Error while compiling Web Dynpro program due to missing JAR files

    Hi Experts,
    I am getting error message while compiling Web Dynpro program. The erring lines are as below:
              Message message = new MimeMessage(session);
              try {
                   message.setFrom(new InternetAddress(fromMailId));
                   message.addRecipient(
                        Message.RecipientType.TO,
                        new InternetAddress(toMailId));
                   message.setSubject(mailSubject);
                   message.setText(mailBody);
                   message.setHeader("X-Mailer", "E-Mail");
                   message.setSentDate(new Date());
                   Transport.send(message);
    The error messages are:
    Message.ReceipientType can not be resolved
    The method send(Message) is undefined for the type Transport
    The method setFrom(InternetAddress) is undefined for the type Message
    The method setHeader(String, String) is undefined for the type MessageThe method setSentDate(Date) is undefined for the type Message
    The method setSubject(String) is undefined for the type Message
    The method setText(String) is undefined for the type Message
    Type mismatch: cannot convert from MimeMessage to Message
    Can you please help me in resolving the issue. It seems that some API is missing. I believe if some one can tell me the name of JAR file / API then I will be able to sort out the issue. I will add these JAR file in my program.
    Thanks,
    S

    HI Stuart,
    you are missing the jar files required for sending mail in java
    Installing JavaMail
    You will need the latest version of JavaMail (Version 1.2) available here:
    http://java.sun.com/products/javamail/
    Download and unzip the file, in the newly created top level JavaMail directory you will find a number of jar files,
    these need adding to your classpath.
    To do this in Eclipse, right click on your project in the tree view, select properties, select the libraries tab.
    Now click the 'Add external jars' button, navigate to your JavaMail directory and click on the jars.
    The tutorial also makes use of the Java Activation Framework, which is available here:
    http://java.sun.com/products/javabeans/glasgow/jaf.html
    Instalation of JAF is identical to JavaMail
    activation.jar / mail.jar are 2 distinct names i remember rest you will get above
    P.S: close the question to assist other users narrow the search and find solutions
    Message was edited by:
            Armin Reichert

  • Java error while compiling Web Dynpro program

    Hi Experts,
    I am getting following error message while compiling Web Dynpro program. The erring lines are as below:
              Message message = new MimeMessage(session);
              try {
                   message.setFrom(new InternetAddress(fromMailId));
                   message.addRecipient(
                        Message.RecipientType.TO,
                        new InternetAddress(toMailId));
                   message.setSubject(mailSubject);
                   message.setText(mailBody);
                   message.setHeader("X-Mailer", "E-Mail");
                   message.setSentDate(new Date());
                   Transport.send(message);
    The error messages are:
    Message.ReceipientType can not be resolved
    The method send(Message) is undefined for the type Transport
    The method setFrom(InternetAddress) is undefined for the type Message
    The method setHeader(String, String) is undefined for the type MessageThe method setSentDate(Date) is undefined for the type Message
    The method setSubject(String) is undefined for the type Message
    The method setText(String) is undefined for the type Message
    Type mismatch: cannot convert from MimeMessage to Message
    Can you please help me in resolving the issue. It seems that some API is missing. I believe if some one can tell me the name of JAR file / API then I will be able to sort out the issue. I will add these JAR file in my program.
    Thanks,
    S

    Hi,
    Have you imported the required JavaMail jar?
    Please tell me what API you are using for the same.
    Also check Barcode Printing from EP --using barcode4J (Gurus kindly help me) forum to check how to add external jar files into WebDynpro project
    Let me know if you need more help on it.
    Regards,
    Ashutosh

  • Problem in compiling and running programs in Java3D

    Dear Friends,
    I'm newly installed Java 3D in my c:\ alreadey I'm havind jdk1.3 but java 3D created a new folder namely jdk1.2.2 in c:\. Now I am trying to compile my first program through javac but it couldn't find the libraries. In documentation this is given that don't set any path for java 3d. I've tried to run the demo programs through appletviewer but it couldn't. It is some what happening while I'm clicking the links to run. but it is very sluggish in ie5.
    Pl. give me the needed solution, eigther here or at : [email protected]
    Thanks,
    K.Ranganathan.

    follow the installtion guide for java3d on this site (java.sun.com)
    To summarise it.... Java3D 1.2 is designed for Java1.2.2, however if, when installing it, u install it to the Java1.3 dir it should work fine...... mine does ;-P
    AbU5e,

  • Problem in compiling pro * c program

    Hi
    Greetings ,
    I am new to proc, i wrote a small sample program while compiling this program in vc++ 6.0 i am getting the following error
    c:\proheaderfiles\database.c(24) : error C2061: syntax error : identifier 'SQL'
    c:\proheaderfiles\database.c(24) : error C2059: syntax error : ';'
    c:\proheaderfiles\database.c(24) : error C2054: expected '(' to follow 'TYPE'
    can anyone help me in this regard
    Thanks in advance

    First compile the proc programe through
    windows version proc ,generate the *.cpp file;
    Second : add the *.cpp file to visual c++ project
    Then compile with visual c++;

  • Problem compiling my first program; Please Help me!

    Please HELP, what am I doing wrong?
    For over 5hours I have been trying to figure out how to compile a simple Hello world program using sdk1.3.1_02/j2re1.3.1_02 and I am getting the following errors: helloworld.java:2 cannot resolve symbol
    symbol : class string
    location : class helloworld
    cannot reolve the string symbol
    symbol : class out
    location : package system
    I want to program in java so badly but I am trying to get my environment set so that I can take off. To compile my first program has been a disaster!!
    This is my path:
    SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\JDK1.3.1_02\BIN
    Thanks very much in advance
    ::(

    Java is case sensitive,
    use String instead of string. and System.out instead of system.out
    Sudha

  • 32bit Oracle ODBC Driver on 64bit RHEL 5.9 system

    I am using unixODBC as my driver manager and 32 bit Oracle Client/Driver on Linux RHEL 5.9 64bit OS.  I cannot seem to get a successful test with isql with 32bit ODBC Driver, i get success with 64bit ODBC Driver.

    It is possible to get 32bit drivers to work on 64bit OS as long as the application you're using is 32bit.
    Did you make sure that your unxiODBC driver manager is 32bit, that you have specified the 32bit libraries (also the 32bit Oracle client) in your LD_LIBRARY_PATH and that you're also using the 32bit isql?
    What's the error message you're getting?
    - Klaus

Maybe you are looking for