Re: Problem Linking (win32)



bwaichu@xxxxxxxxx wrote:
Per another discussion here, I decided to switch to using the win32
object format via nasm -f win32, and I went with the golink linker. I
was not able to find an app call alib to work with alink.

http://alink.sourceforge.net/download.html

But GoLink may be a better choice (never used it).

....
;assemble
;nasm -f win32 win32_func.asm
;golink /entry _start win32_func.obj kernel32.dll user32.dll
msvcrt.dll

extern MessageBoxA
extern ExitProcess
extern sprintf

section .code code CLASS=CODE

"-f win32" knows "section .text", "section .data", "section .bss", and "section .rdata", and knows the proper attributes. Probably have less trouble if you use 'em.

....
call [sprintf]

Pretty sure you don't want the "[]" here.

No idea if either of those will fix the "invalid handle" problem. "Courage", Brian! :)

Best,
Frank

.