I'm trying to compile an example nasm program I downloaded for windows. But I can't get it to compile.
C:\nasm-2.06rc1\nasmw -f win32 example.asm
C:\lcc\bin\lcclnk -s -subsystem windows example.obj
When I compile it with that, the first part of it goes fine, it's when I use lcclnk to link it I get these error messages:
C:\Documents and Settings\Administrator\Desktop\NASM\DEMO>C:\lcc\bin\lcclnk -s -
subsystem windows example.obj
example.obj .text: undefined reference to 'LoadIconA'
example.obj .text: undefined reference to 'LoadCursorA'
example.obj .text: undefined reference to 'RegisterClassA'
example.obj .text: undefined reference to 'GetLastError'
example.obj .text: undefined reference to 'CreateWindowExA'
example.obj .text: undefined reference to 'ShowWindow'
example.obj .text: undefined reference to 'UpdateWindow'
example.obj .text: undefined reference to 'GetMessageA'
example.obj .text: undefined reference to 'TranslateMessage'
example.obj .text: undefined reference to 'DispatchMessageA'
example.obj .text: undefined reference to 'ExitProcess'
example.obj .text: undefined reference to 'DefWindowProcA'
example.obj .text: undefined reference to 'PostQuitMessage'
example.obj .text: undefined reference to 'BeginPaint'
example.obj .text: undefined reference to 'DrawTextA'
example.obj .text: undefined reference to 'EndPaint'
Here's the first part of my code:
%include "C:\Documents and Settings\Administrator\Desktop\NASM\DEMO\win32n.inc"
extern RegisterClassA
extern CreateWindowExA
extern CreateWindow
extern ShowWindow
extern UpdateWindow
extern GetMessageA
extern TranslateMessage
extern DispatchMessageA
extern DefWindowProcA
extern ExitProcess
extern MessageBeep
extern GetLastError
extern LoadIconA
extern LoadCursorA
extern PostQuitMessage
extern BeginPaint
extern EndPaint
extern DrawTextA
global _WinMain@16
SEGMENT .text USE32 class=code
_WinMain@16:
%define ebp_hInstance ebp+8 ; handle of current instance
%define ebp_hPrevInstance ebp+0ch ; handle of previous instance
%define ebp_lpszCmdLine ebp+10h ; pointer to command line
%define ebp_nCmdShow ebp+14h ; show state of window
I'm determined to get this working, as I really want to start coding in NASM for windows.
Thanks in advance.