ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
When compiling, I get one warning that may cause a segfault. With -Wall I get other warnings. Fix them before doing anything else, or you're just wasting your time.
I assume you didn't write this program, someone else did.
I assume whoever that was, only tested the program on a 32 bit OS.
I see you are compiling it on a 64 bit OS. Fixing the bugs that cause it to fail when compiled for 64 bits would be appropriate if it were you own program. But that might not be the best approach for your current needs.
If decent 32 bit support is installed in your 64 bit Linux system, I think you can get the program to work by compiling it as a 32 bit program, which may be as simple as using
Code:
gcc -m32 -O2 juno.c -o juno
instead of
Code:
gcc -O2 juno.c -o juno
I'm pretty sure the bug symptoms are only driven the architecture of the program itself, not by the architecture of the OS. So as a 32 bit program on a 64 bit OS, I think the program is likely to work.
Even if the program runs apparently correctly (free of seg faults or other of what I am calling bug symptoms) when compiled for 32 bit, that does not mean the program is free of actual bugs under those conditions. This program has enough bugs it is hard to even judge the intent well enough to fix the bugs. But the bugs might be symptom free in a 32 bit build. I wouldn't know without trying and I don't know whether you posted enough for me to try nor whether trying would be wise if I could.
If decent 32 bit support is installed in your 64 bit Linux system
Quote:
Originally Posted by hooxs
Code:
[root@vps ~]# gcc -m32 -O2 juno.c -o juno
In file included from /usr/include/features.h:352,
from /usr/include/string.h:26,
from juno.c:15:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
!!!
OK, you have dis-proven my guess that decent 32 bit support is installed on your Linux system.
I previously read a lot of facts you didn't state into some of the obscure details you did post.
But suddenly I'm failing to notice the hooks from which to deduce other such facts. So maybe you can give us some background such as what distribution you are using, what package manager you use (and whether you actually know how to use it etc.) that might be relevant to the question of whether installing some 32 bit support is worth your trouble.
I still think a 32 bit build of your program is likely to work. But I can't promise that. I don't know how hard it would be for you to install 32 bit support or your system in order to find out.
For example, if your distribution is Ubuntu, there is a web site (which I just checked) for finding the package for any missing file. For the first file whose absence caused -m32 to fail for you, I found:
I think there is some meta package of 32 bit support that includes that package plus several related ones you might also need. But I never remember the name of that meta package nor how to look it up. If any Debian or Ubuntu experts are reading this, I expect one of them will remember what I mean.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.