Issue
I just started learning assembly, but when i tried to compile the code i just get an error.
I can make the object file with nasm -f win64 main.asm -o main.o
but when i try to use ld -o main main.o
or gcc -o main main.o
i just get an error saying main.o: file not recognized: file format not recognized
. I tried to use wsl and there ld worked fine but I don't want to use that whenever I need to compile.
I am running windows 10 64 bit.
Solution
It turned out that the toolchain I was using was 32-bit and only managed to link 32-bit object files while my object file was 64-bit. This caued my error and when I updated to a 64-bit toolchain it worked.
Answered By - Nikolai Answer Checked By - Marilyn (WPSolving Volunteer)