See freebasic forum https://www.freebasic.net/forum/viewtopic.php?f=3&t=26881&p=249624
There is a bug in the freebasic compiler.
There are 9 declare functions in pnglib pblib2.bi
And yet the compiler only complains about one of them.
Code: Select all
declare function PNG_LoadFile stdcall alias "PNG_LoadFile" (byval pPNGInfo as PNGINFO ptr, byval lpFileName as string) as integer
The compiler says "undefined reference to `PNG_LoadFile@16' "
Think about it. the @16 says it needs 4 dwords for the parameters.(16 bytes)
And yet when you look at this function, It only need 2 dwords.(8 bytes)
I put pnglib2.a in notepad++, it mentions "_PNG_LoadFile@8": 2 dwords
This is a bug in freebasic 1.05 !
Think about it. the @16 says it needs 4 dwords for the parameters.(16 bytes)
[true, with a "string"!] but:
Nope, a string is a FreeBASIC Type, consisting of: 1 x ptr and 2 x integer, therefore, 12 bytes (only valid in FBC32!) since, sizes double in FBC x64.
The declaration should be, on the second parameter:
byval lpFileName as zstring ptr ...
Therefore, NO error / bug in the compiler! Simply a fault, in the declaration!
Fixed in commit [d249ff]
Related to [#890]
Also,if library is written for fbc, may need to recompile the the library. Sometimes the binary compatibility changes from one version of fbc to the next as bugs are fixed, or features added.
Related
Bugs:
#890Commit: [d249ff]