C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 10-09-2009, 08:12 PM   #1
Registered User
 
Join Date: Sep 2007
Posts: 4
compiling assembly in linux with nasm

So I started messing around with assembly but I am having some issues compiling.

From the directions on one page I followed i did
Code:
nasm -f elf program1.asm
ls program1.o -o program1
But then I got this error message
Code:
ld: i386 architecture of input file `program1.o' is incompatible with i386:x86-64 output
So I looked up the error and there wasnt a clear answer, but it seems the linker is trying to do 64 bit and nasm is doing 32bit? Am I on the right track?
nano78 is offline   Reply With Quote
Old 10-09-2009, 09:10 PM   #2
Senior software engineer
 
brewbuck's Avatar
 
Join Date: Mar 2007
Location: Portland, OR
Posts: 5,381
If your version of NASM is 2.00 or greater, try using "-f elf64" instead of "-f elf"
__________________
"Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot
brewbuck is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling Linux kernel on Windows jmd15 Linux Programming 9 04-10-2006 07:28 AM
Compiling a C program in Linux hern C Programming 14 06-28-2004 08:33 PM
Code not compiling in Linux CompiledMonkey C++ Programming 5 06-22-2004 09:06 AM
Linux for Windows! Strut Linux Programming 2 12-25-2002 11:36 AM
Linux? Windows Xp? VooDoo Linux Programming 15 07-31-2002 08:18 AM


All times are GMT -6. The time now is 11:05 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22