Can someone give me some pointers where im going wrong, im new to assembly, GCC, C, NASM, NASMW.
I cant get past this error when trying to make the object, is there something extra i need to install.
C:\test>nasmw -f win32 prog.asm -o prog.obj
prog.asm:12: error: symbol `_printf' undefined

Recommended Answers

All 2 Replies

_printf is not resolved until linked, therefore you have to make the complier aware of this.

extern  _printf

I haven't had any success using standard "C" libraires so I use wsprintf which is part of kernel32.lib

C library functions (like printf) are typically prefixed with an underscore. In in the object library it is actually named _printf.

If you plan to use them you must also link the library itself. How to do this varies between assemblers / linkers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.