Linking Assembly Code - Can't resolve printf
Wed Sep 20 07:13:00 GMT 2006
I have a simple assembly program that I am trying to compile, but ld cannot
#movtest3.s - Example using index memory locations
.asciz "The value is %d\n"
movl $0, %edi
movl values(, %edi, 4), %eax
addl $8, %esp
cmpl $11, %edi
movl $0, %ebx
movl $1, %eax
#end of ASM
as -o indexedMemory.o indexedMemory.s
ld --verbose -o indexedMemory indexedMemory.o -lc
#end of Makefile
Result is always:
attempt to open indexedMemory.o succeeded
attempt to open /usr/bin/../lib/libc.dll.a failed
attempt to open /usr/bin/../lib/c.dll.a failed
attempt to open /usr/bin/../lib/libc.a succeeded
indexedMemory.o:fake:(.text+0x14): undefined reference to `printf'
make: *** [test] Error 1
#end of result
I've tried linking in numerous libraries, hoping one would resolve printf,
and in numerous order of where to include the -lxxx, but I can't get it to
compile. I've also tried it on numerous computers, including those with a
first-time fresh install of cygwin. Compiling a simple helloworld C program
I've compiled the same program fine in linux using as/ld.
What am I doing wrong???
Thank you for any help,
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin