News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

assembling error

Started by max, January 10, 2012, 06:40:25 AM

Previous topic - Next topic

max

my prolem...
       when i m running a program whiich is in C:\masm32\examples\exampl01\popup\popup.asm it successfully create an object file but when i want to link using the following command it giving the error like  following and it cant create an exe file plz help me

compile....  :(

C:\masm32\bin>ml popup.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: popup.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/z2
"popup.obj"
"popup.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
popup.obj : warning LNK4033: converting object format from OMF to COFF
LINK : fatal error LNK1181: cannot open input file "popup.exe"


link........ :(


C:\masm32\bin>link popup.obj
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

popup.obj : warning LNK4033: converting object format from OMF to COFF
popup.obj : error LNK2001: unresolved external symbol _GetModuleHandleA@4
popup.obj : error LNK2001: unresolved external symbol _DispatchMessageA@4
popup.obj : error LNK2001: unresolved external symbol _GetCommandLineA@0
popup.obj : error LNK2001: unresolved external symbol _PostQuitMessage@4
popup.obj : error LNK2001: unresolved external symbol _GetStockObject@4
popup.obj : error LNK2001: unresolved external symbol _SendMessageA@16
popup.obj : error LNK2001: unresolved external symbol _GetSystemMetrics@4
popup.obj : error LNK2001: unresolved external symbol _ShowWindow@8
popup.obj : error LNK2001: unresolved external symbol _TranslateMessage@4
popup.obj : error LNK2001: unresolved external symbol _CreateWindowExA@48
popup.obj : error LNK2001: unresolved external symbol _UpdateWindow@4
popup.obj : error LNK2001: unresolved external symbol _CallWindowProcA@20
popup.obj : error LNK2001: unresolved external symbol _SetWindowLongA@12
popup.obj : error LNK2001: unresolved external symbol _ExitProcess@4
popup.obj : error LNK2001: unresolved external symbol _GetMessageA@16
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
popup.exe : fatal error LNK1120: 16 unresolved externals



hutch--

#1
max,

That example is designed to be run from the editor. Just select "Project" on the menu then the option "Assemble & Link" and it will build OK. Here is a batch file that will also build the example.  << typo fixed.

LATER : save the batch file below as MAKEIT.BAT, put it in the same directory as popup.asm then run the batch file.



@echo off

if not exist rsrc.rc goto over1
\masm32\bin\rc /v rsrc.rc
\masm32\bin\cvtres /machine:ix86 rsrc.res
:over1

if exist "popup.obj" del "popup.obj"
if exist "popup.exe" del "popup.exe"

\masm32\bin\ml /c /coff "popup.asm"
if errorlevel 1 goto errasm

if not exist rsrc.obj goto nores

\masm32\bin\Link /SUBSYSTEM:WINDOWS /OPT:NOREF "popup.obj" rsrc.res
if errorlevel 1 goto errlink

dir "popup.*"
goto TheEnd

:nores
\masm32\bin\Link /SUBSYSTEM:WINDOWS /OPT:NOREF "popup.obj"
if errorlevel 1 goto errlink
dir "popup.*"
goto TheEnd

:errlink
echo _
echo Link error
goto TheEnd

:errasm
echo _
echo Assembly Error
goto TheEnd

:TheEnd

pause
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php