flat assembler
Message board for the users of flat assembler.

Index > Windows > FASM + ALINK problem.

Author
Thread Post new topic Reply to topic
wyvern



Joined: 08 Dec 2011
Posts: 27
wyvern 10 Dec 2011, 01:14
Hi all. I am trying to generate an .exe with FASM+ALINK. The Code:
Code:
FORMAT MS COFF
PUBLIC _start
 
EXTRN MessageBoxA
EXTRN ExitProcess
 
MB_OK              = 00000000h
MB_ICONINFORMATION = 00000040h
     
SECTION '.text' code readable executable   
_start:
        PUSH MB_OK+MB_ICONINFORMATION   
        PUSH title     
        PUSH msg   
        PUSH 0 

        CALL MessageBoxA                
             
        PUSH 0      
        CALL ExitProcess     
     
SECTION '.data' data readable writeable   
        title  db 'hello...',0      
        msg db 'world',0   
    


Command line:
fasm helloworld.asm
alink -oPE helloworld.obj KERNEL32.lib USER32.lib

Quote:

The output from ALINK:
Loading file helloworld.obj
Loading file KERNEL32.lib
1463 symbols
Loaded first linker member
Loading file USER32.lib
1235 symbols
Loaded first linker member
matched Externs
matched ComDefs
Unresolved external MessageBoxA
Unresolved external ExitProcess


This is using the MASM .lib files. But I have tried the .lib files with undecorated functions generated by DLL2LIB and in that case i got another error:

Quote:

Loading file helloworld.obj
Loading file KERNEL32.lib
1887 symbols
Loaded first linker member
Loading file USER32.lib
1467 symbols
Loaded first linker member
Loading module user32.DLL/
Invalid Import entry


Please note that i had success with LINK/POLINK, but i would like to know how to use another linkers. Some suggestion for mi problem with ALINK?

Thanks.

_________________
Thanks
Post 10 Dec 2011, 01:14
View user's profile Send private message Reply with quote
Yardman



Joined: 12 Apr 2005
Posts: 244
Location: US
Yardman 10 Dec 2011, 05:57
[ Post removed by author. ]


Last edited by Yardman on 04 Apr 2012, 03:50; edited 1 time in total
Post 10 Dec 2011, 05:57
View user's profile Send private message Reply with quote
wyvern



Joined: 08 Dec 2011
Posts: 27
wyvern 10 Dec 2011, 12:19
Oh , THANK YOU Yardman!, now it works like a charm. But please can you explain me at least something about what is "ALIB" and why is needed in this case?. I mean it seems every linker need diferent version of the .lib files... and i dont know exactly why...
Post 10 Dec 2011, 12:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.