473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to compile 32 bit application on 64 bit machine?

Hello All,

I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.
Can somebody tell me how I can compile a .c file for 32 bit on a 64
bit machine.

Thanks in advance
-Vittal
Nov 13 '05 #1
11 19018
Vittal <vs*********@yahoo.com> wrote:
Hello All,

I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.
Can somebody tell me how I can compile a .c file for 32 bit on a 64
bit machine.


Wrong newsgroup! Post in a group that discusses programming on your
platform/system or even the GNU compiler collection (gnu.gcc).
--
Z (Zo**********@daimlerchrysler.com)
"LISP is worth learning for the profound enlightenment experience
you will have when you finally get it; that experience will make you
a better programmer for the rest of your days." -- Eric S. Raymond
Nov 13 '05 #2
On 10 Jul 2003 23:07:50 -0700,
Vittal <vs*********@yahoo.com> wrote:
Hello All,

I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.


The newsgroup comp.lang.c is for the discussion of the C language; not
for discussion of compiler options. You should probably ask your
question on gnu.gcc.help, where people discuss gcc.

Martien
--
|
Martien Verbruggen | We are born naked, wet and hungry. Then
| things get worse.
|
Nov 13 '05 #3
vs*********@yahoo.com (Vittal) wrote in message news:<f9**************************@posting.google. com>...
Hello All,

I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.
Can somebody tell me how I can compile a .c file for 32 bit on a 64
bit machine.


Off topic. Probably some compiler option - a switch or a pragma or
something. What does your documentation say?
Nov 13 '05 #4
In <f9**************************@posting.google.com > vs*********@yahoo.com (Vittal) writes:
I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.
Can somebody tell me how I can compile a .c file for 32 bit on a 64
bit machine.


Without knowing what 64-bit Linux machine you have (Alpha, SPARC, Itanium,
whatever) there is no meaningful way of answering your question. On some
platforms, it's simply a matter of choosing the sizes of certain C types
and using the appropriate libraries, on others, a second gcc installation
is needed, because a completely different instruction set must be used
in the generated code (e.g. on Itanium).

Go to a newsgroup dedicated to Linux on your hardware platform: it is the
only place on Usenet that can provide the information you're looking for.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 13 '05 #5
Sorry for dragging you all to a off topic and thanks for redirecting
me to a correct group.

Thanks
-Vittal
Martien Verbruggen <mg**@tradingpost.com.au> wrote in message news:<sl*****************@martien.heliotrope.home> ...
On 10 Jul 2003 23:07:50 -0700,
Vittal <vs*********@yahoo.com> wrote:
Hello All,

I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.


The newsgroup comp.lang.c is for the discussion of the C language; not
for discussion of compiler options. You should probably ask your
question on gnu.gcc.help, where people discuss gcc.

Martien

Nov 13 '05 #6
Sorry for not providing all details.

I am using Itanium Linux 64 bit machine and I have GCC 3.2.2 installed in it.

$ uname -a
Linux titanin 2.4.9-18smp #1 SMP Tue Dec 11 12:59:00 EST 2001 ia64 unknown

Any further help on this issue is greatly appreciated.

Thanks
-Vittal

Da*****@cern.ch (Dan Pop) wrote in message news:<be**********@sunnews.cern.ch>...
In <f9**************************@posting.google.com > vs*********@yahoo.com (Vittal) writes:
I have a Linux 64 bit machine and I have installed GCC 3.2.2 on it.
Now I want to a compile a small .c file for 32 bit. I tried to use
-m32 option for compiling the file as 32 bit. But my compiler failed
to recognise that option.
Can somebody tell me how I can compile a .c file for 32 bit on a 64
bit machine.


Without knowing what 64-bit Linux machine you have (Alpha, SPARC, Itanium,
whatever) there is no meaningful way of answering your question. On some
platforms, it's simply a matter of choosing the sizes of certain C types
and using the appropriate libraries, on others, a second gcc installation
is needed, because a completely different instruction set must be used
in the generated code (e.g. on Itanium).

Go to a newsgroup dedicated to Linux on your hardware platform: it is the
only place on Usenet that can provide the information you're looking for.

Dan

Nov 13 '05 #7
Vittal wrote:
Sorry for not providing all details.

I am using Itanium Linux 64 bit machine and I have GCC 3.2.2 installed in it.

$ uname -a
Linux titanin 2.4.9-18smp #1 SMP Tue Dec 11 12:59:00 EST 2001 ia64 unknown

Any further help on this issue is greatly appreciated.


Hmm? ia64 is a superset of ia32 is it not? So to compile ia32 just use
"-march=i386" when you build. E.g.

gcc -march=i386 foo.c -o foo

Not having access to a ia64 port of GCC I can't say if this will work
but if it truly is a superset than logically GCC for ia64 should be able
to limit itself to ia32 [via -march].

Failing that you could always build a cross-compiler [see the gcc folks
for info on doing that].

Tom

Nov 13 '05 #8
In article <cO********************@news02.bloor.is.net.cable. rogers.com>,
to********@iahu.ca says...
I am using Itanium Linux 64 bit machine and I have GCC 3.2.2 installed in it.

$ uname -a
Linux titanin 2.4.9-18smp #1 SMP Tue Dec 11 12:59:00 EST 2001 ia64 unknown

Any further help on this issue is greatly appreciated.


Hmm? ia64 is a superset of ia32 is it not?


Not even close. Opteron is a much closer match to your description than
Itanium ever hoped to be. This is a prime example of why answering
OT questions is a bad idea. This and everything downstream is bogus.

--
Randy Howard
(remove the obvious bits from my address to reply.)
"Most of the drivers nowadays are a bit like Eddie Irvine, who if
he was half as fast as he thought he was, would be moderate."
-- Sir Stirling Moss
Nov 13 '05 #9
Randy Howard wrote:
In article <cO********************@news02.bloor.is.net.cable. rogers.com>,
to********@iahu.ca says...
I am using Itanium Linux 64 bit machine and I have GCC 3.2.2 installed in it.

$ uname -a
Linux titanin 2.4.9-18smp #1 SMP Tue Dec 11 12:59:00 EST 2001 ia64 unknown

Any further help on this issue is greatly appreciated.


Hmm? ia64 is a superset of ia32 is it not?

Not even close. Opteron is a much closer match to your description than
Itanium ever hoped to be. This is a prime example of why answering
OT questions is a bad idea. This and everything downstream is bogus.


My last suggestion was valid. A cross-compiler would natively target
the ia32.

And in the meantime AMD r0x0rz

Lameass second-hand 64-bit processors.... I'll stick with my thermal
nuclear XP 2400+ thank ya :-)

Tom

Nov 13 '05 #10
> we don't care, its not a C question. its an implementation question.
Than guiding correctly some guys are very much showing how much genious they are...
May be its not C question.If not interested just don't answer, just ignore...!!

'Words' reflect your attitude.

-Calvin
Mark McIntyre <ma**********@spamcop.net> wrote in message news:<dd********************************@4ax.com>. ..
On 14 Jul 2003 11:24:40 -0700, in comp.lang.c , vs*********@yahoo.com
(Vittal) wrote:
Sorry for not providing all details.


Are you also sorry for
a) top posting
b) not READING Dan's quite correct response:

" Go to a newsgroup dedicated to Linux on your hardware platform: it
is the only place on Usenet that can provide the information you're
looking for."
I am using Itanium Linux 64 bit machine and I have GCC 3.2.2 installed in it.


we don't care, its not a C question. its an implementation question.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Nov 13 '05 #11
On 15 Jul 2003 03:04:35 -0700, in comp.lang.c ,
un*********@rediffmail.com (Unix Calvin) wrote:

(quoting me, and inexplicably also including my entire post lower
down)
we don't care, its not a C question. its an implementation question.
Than guiding correctly some guys are very much showing how much genious they are...
Not sure what you're trying to say here, but in my post I pointed out
that you had already been redirected to the right place, and that
you'd ignored that redirection. Thats rude
May be its not C question.If not interested just don't answer, just ignore...!!
Whether I'm interested or not is irrelevant. The point is, you posted
in the wrong place, I advised you of that, which I believe is the
correct thing to do. Otherwise you'd just keep asking and asking.
'Words' reflect your attitude.


Perhaps you should consider that you posted 'words' yourself, even
after twice being advised you were in the wrong place.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 13 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: edward hage | last post by:
Hello, I have a Linux machine and I use Netscape 7.1 which I upgraded from Mozilla. I downloaded j2sdj-1.4.2_02 and I have installed the plugins as followes: in .mozilla/plugins- directory a...
4
by: Vince | last post by:
I'm getting this message when I try and run a .net web app in the development system: CS0016: Could not write to output file 'c#:\windows nt\Microsoft..net framework\v1.1.4322\Temporary ASP.NET...
2
by: MB | last post by:
Hello! At home I am using ASP.net to develop an asp application. Now I have copied this application to my IIS5.0 server at my workplace. Everything works fine, but then I would do a change in a...
14
by: NRGeti | last post by:
I am learning ASP.NET using the book, "ASP.NET for Dummies". In the chapter introducing writing your own functions, I cannot get the example to run when I call it with LOCALHOST. It produces the IE...
0
by: geodev | last post by:
Hello, I’m developing my first ASP.NET website with Visual Studio.NET 2002 (It’s also the first time I’m using VS.NET as well). I’m utilising both ASP.NET and VB.NET. I have completed...
4
by: Seok Bee | last post by:
Dear Experts, I've completed my console application and now wants to compile the application and an executable file to be run at another location. However, I've tried compiling that program in...
2
by: APA | last post by:
The problem is that there is no reference to the DLL anywhere in the solution. I have other developers running this identical solution with no problems but on my machine it won't compile if I don't...
0
by: dot | last post by:
I spent a few headache filled days trying to use GMP on windows (XP pro) I finally got it to work and since I found little help on the Web I thought someone might find what i did useful. ...
10
by: nik | last post by:
Hi, I've compiled my application on my vista machine, and it won't run at all on my xp machine. In the windows error report I get Exception code; 0xe0434f4d. I searched for that exception, but...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.