Hi Vid,
I'm having trouble with fasmlib... specifically linking?
I originally was working with alink to get my generated object files made into an executable... I've tried linking with microsoft's linker as well but I get similar errors.
Here's the assembly file I'm working with (hello.asm):
Code: |
%include "fasmlib.inc"
global _start
[section .text]
_start:
;initialize FASMLIB
call fasmlib.init
jc error
;display string
push _hello
call stdout.write
jc error
;uninitialize FASMLIB
call fasmlib.uninit
jc error
;exit with code 0
push 0
call process.exit
;error handler
error:
;get error message
push eax
call err.text
;display error message
push eax
push _err_format
call stderr.write.format
;uninitialize FASMLIB
call fasmlib.shutdown
;exit with code 1
push 1
call process.exit
[section .data]
_hello db "Hell o' World",10,0
_err_format db 10,"Error: %s",10,0
|
|
And here's the process that I'm going through to get the errors I've gotten:
nasm -fcoff "hello.asm" -o test.obj
alink -oPE -subsys console test.obj fasmlib.obj fasmlib2.obj fasmlib2.lib libcmt.lib -o test.exe
ALINK v1.6 (C) Copyright 1998-9 Anthony A.J. Williams.
All Rights Reserved
Loading file test.obj
Loading file fasmlib.obj
Loading file fasmlib2.obj
Loading file fasmlib2.lib
415 symbols
Loaded first linker member
Loading file libcmt.lib
5933 symbols
Loaded first linker member
matched Externs
matched ComDefs
Unresolved external __imp__GetProcessHeap@0
Unresolved external __imp__HeapAlloc@12
Unresolved external __imp__GetLastError@0
Unresolved external __imp__HeapFree@12
Unresolved external __imp__HeapReAlloc@16
Unresolved external __imp__CreateFileA@28
Unresolved external __imp__CloseHandle@4
Unresolved external __imp__ReadFile@20
Unresolved external __imp__WriteFile@20
Unresolved external __imp__SetFilePointer@16
Unresolved external __imp__ExitProcess@4
Unresolved external __imp__GetStdHandle@4
Unresolved external __imp__GetProcessHeap@0
Unresolved external __imp__HeapAlloc@12
Unresolved external __imp__GetLastError@0
Unresolved external __imp__HeapFree@12
Unresolved external __imp__HeapReAlloc@16
Unresolved external __imp__CreateFileA@28
Unresolved external __imp__CloseHandle@4
Unresolved external __imp__ReadFile@20
Unresolved external __imp__WriteFile@20
Unresolved external __imp__SetFilePointer@16
Unresolved external __imp__ExitProcess@4
Unresolved external __imp__GetStdHandle@4
Any help you could give would surely be appreciated, thanks,
Dominick