NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: killer13666 on July 04, 2015, 03:03:35 PM
-
I want to assemble some assembly routines for use in my C++ programs, but I am having some issues. When I assemble the file into an ELF object, the linker doesn't have any issues. But if I try to assemble the file into an ELF64 object, the linker says the object is of an unrecognized file format. How can I fix this?
-
Firstly, are you using the linker/loader called "ld" or some other linker?
If have have gcc installed try executing the following:
nasm -f elf64 yourfilename.asm -o yourfilename.o
gcc -Wall -s -o yourfilename yourfilename.o
Did it link and can you now successfully execute it?
-
Yes, I am using ld.exe. I did try that and it still said that the file is of unrecognized format. I asked this same question on the Code::Blocks forum, thinking it was a problem with the IDE at first, but was told to post it here. The link is http://forums.codeblocks.org/index.php/topic,20394.new.html#new (http://forums.codeblocks.org/index.php/topic,20394.new.html#new), which has everything I have tried so far. I think that the problem might be because I have 32-bit mingw, so I am installing the 64-bit version now.
-
The 64-bit version did work without issues. I didn't know Code::Blocks came with the 32-bit version.
-
Glad to hear you solved it. 8)