Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

i have a problem when used c function in my program

$
0
0
Hi everyone...!
Friends, i have a probelm in programing with GNU assembller...!
When i want linked my program!
following code!
.section .data 
output: .asciz “The value is: %d\n”
.section .text
.globl _start 
_start: 
nop
movl $100, %ecx 
movl $0, %eax 
loop1: 
addl %ecx, %eax 
loop loop1 
pushl %eax 
pushl $output 
call printf 
add $8, %esp 
movl $1, %eax 
movl $0, %ebx 
int $0x80


linker displayed this error for me.
undifined refrence to "printf"

with command i linked this code ....
ld -dynamic-linker /lib/ld-linux.so.2 mycode.o -o mycode

but showing error in the output..
how i can fix this problem?!

sorry for bad english speaking!

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>