어셈블과 C 링크 문제
글쓴이: Fe.head / 작성시간: 수, 2005/06/29 - 10:17오전
어셈블러하고 C를 링크 하여 실행파일을 만들려고 하는데 자꾸 에러가 발생하네요.
어떤 조치를 취해야 하는지 가르켜 주세요 :cry:
// eaxm2.c
#include <stdio.h>
int main()
{
print_it();
return 0;
}
[bits 32]
;exam2.asm
segment .data
lucky db "Lucky number is %d", 0
segment .text
[global print_it]
[extern printf]
print_it:
push ebp
mov ebp, esp
push dword 7
push lucky
call printf
mov esp, ebp
pop ebp
ret
mls $ nasm -f coff -o exam2_asm.o exam2.asm
mls $ gcc -c exam2.c
mls $ gcc -o exam2 exam2.o exam2_asm.o
exam2_asm.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Forums:


아. 알았습니다.man nasm 하니깐 바로 나오는군요.
아. 알았습니다.
man nasm 하니깐 바로 나오는군요.
nasm -f elf ...
하니깐 되는군요.. :oops:
고작 블로킹 하나, 고작 25점 중에 1점, 고작 부활동
"만약 그 순간이 온다면 그때가 네가 배구에 빠지는 순간이야"
댓글 달기