flat assembler
Message board for the users of flat assembler.

Index > Windows > pnglib fasm port?

Author
Thread Post new topic Reply to topic
Ali.Z



Joined: 08 Jan 2018
Posts: 732
Ali.Z 15 May 2024, 09:36
is there any known pnglib port to fasm? pnglib made in 2000s using masm.

i would port it to fasm, but i dont understand masm stuff, or at minimum try to make it a shared library (dll), not sure how difficult the task is.

_________________
Asm For Wise Humans
Post 15 May 2024, 09:36
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1042
Location: Russia
macomics 15 May 2024, 14:59
Just try to specify the -Tpd key for link.exe and append the entry point to the dll to the source.
Post 15 May 2024, 14:59
View user's profile Send private message Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 732
Ali.Z 15 May 2024, 21:15
there is no tpd option.

Quote:
helper.obj : error LNK2001: unresolved external symbol _GetProcessHeap@0
helper.obj : error LNK2001: unresolved external symbol _HeapAlloc@12
helper.obj : error LNK2001: unresolved external symbol _HeapFree@12
PNG_CreateBitmap.obj : error LNK2001: unresolved external symbol _GetDC@4
PNG_CreateBitmap.obj : error LNK2001: unresolved external symbol _ReleaseDC@8
PNG_CreateBitmap.obj : error LNK2001: unresolved external symbol _CreateDIBSection@24
PNG_CreateBitmap.obj : error LNK2001: unresolved external symbol _CreateDIBitmap@24
PNG_LoadFile.obj : error LNK2001: unresolved external symbol _CloseHandle@4
PNG_LoadFile.obj : error LNK2001: unresolved external symbol _CreateFileA@28
PNG_LoadFile.obj : error LNK2001: unresolved external symbol _GetFileSize@8
PNG_LoadFile.obj : error LNK2001: unresolved external symbol _ReadFile@20
PNG_LoadResource.obj : error LNK2001: unresolved external symbol _FindResourceA@12
PNG_LoadResource.obj : error LNK2001: unresolved external symbol _LoadResource@8
PNG_LoadResource.obj : error LNK2001: unresolved external symbol _SizeofResource@8
pnglib_dll.dll : fatal error LNK1120: 14 unresolved externals


help anybody?

edit:
after like 20 trial n error i was able to build the dll, need to test if it works correctly tho.
will post the result after testing.

edit2:
yes works correctly.

edi3:
for anyone wants to use pnglib with fasm, you must build the dll, the steps:

make pnglib.def ;using text editor
paste the following in:
pnglib.def wrote:
LIBRARY pnglib
EXPORTS
PNG_Init
PNG_Cleanup
PNG_CreateBitmap
PNG_Decode
PNG_GetPalette
PNG_LoadCustom
PNG_LoadFile
PNG_LoadResource
PNG_OutputRaw


dont forget to create dllmain.
then use the following commands:
Quote:
ml /c /IC:\masm32\include\ /coff *.asm
link /SUBSYSTEM:WINDOWS /LIBPATH:C:\masm32\lib\ /DLL /IMPLIB:pnglib.lib /DEF:pnglib.def *.obj

_________________
Asm For Wise Humans
Post 15 May 2024, 21:15
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.