I have problem with compilation .asm file on macOS can somebody help me?
Here is my repository: https://github.com/ondrej-111/Asm.git
I tried to compile it with this commands:
nasm -f elf -d macho64 asm_io.asm
nasm -f elf prvy.asm
gcc -c driver.c
gcc -o prvy driver.o prvy.o asm_io.o
but I always get the same error:
ld: warning: ld: warning: ignoring file asm_io.o, file was built for unsupported file format ( 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): asm_io.oignoring file prvy.o, file was built for unsupported file format ( 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): prvy.o
Undefined symbols for architecture x86_64: "_asm_main", referenced from: _main in driver.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I searched some similar issues but any one helped me to fix it.( I tried this - How can I run this assembly code on OS X?)