NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: nobody on September 12, 2005, 04:10:23 AM
-
I am using a VC++6 linker, link.exe. Whenever I try linking I get error 2001:
unresolved external symbol MesageBoxA
unresolved external symbol ExitProcess
Here is my asm file:
%INCLUDE "..\..\inc\win32n.inc"
extern MessageBoxA
extern ExitProcess
SECTION CODE USE32 CLASS=CODE
global _WinMain
_WinMain:
PUSH UINT MB_OK
PUSH LPCTSTR title1
PUSH LPCTSTR string1
PUSH HWND NULL
CALL MessageBoxA
PUSH UINT NULL
CALL ExitProcess
SECTION DATA USE32 CLASS=DATA
string1: db 'Hello world!',13,10,0
title1: db 'Hello',0
I am using the following to assemble my executable:
NasmW.exe -f win32 msgbox1.asm
Link.exe /entry:WinMain /subsystem:windows msgbox1.obj"
What am I doing wrong?
-
> am using the following to assemble my
> executable:
>
> NasmW.exe -f win32 msgbox1.asm
> Link.exe /entry:WinMain /subsystem:windows msgbox1.obj"
Try:
set LIB=DIRIVE:\PATH\TO\MSVC\LIBRARIES
NasmW.exe -f win32 msgbox1.asm
Link.exe /entry:WinMain /subsystem:windows msgbox1.obj user32.lib kernel32.lib
------
nmt
-
I'm still getting the same error. I've also tried:
Link.exe /entry:WinMain /libpath:"C:\Lib" /subsystem:windows msgbox1.obj user32.lib kernel32.lib
Thanks for helping.
-
> unresolved external symbol MesageBoxA
> unresolved external symbol ExitProcess
> [...]
> What am I doing wrong?
You need to link your object file against some
other object file / library / module that provides
those two symbols.