How to use functions from C *.lib files?

New to FreeBASIC? Post your questions here.
diakin
Posts: 89
Joined: May 28, 2005 6:06
Location: Russia, St-Petersburg
Contact:

Postby diakin » May 22, 2008 14:38

phishguy wrote:I'm not sure if this will help, but I found a similar topic on the NI forum that has possible solutions.

http://forums.ni.com/ni/board/message?board.id=250&view=by_date_ascending&message.id=12154


Many thanks for the link!
wallyfblu
Posts: 69
Joined: May 24, 2006 10:58
Location: ITALY

Postby wallyfblu » May 27, 2008 11:09

Hi MichelW, I found this in the MASM source that uses the .lib:

Code: Select all

GridInstall         PROTO   :DWORD


and I tranlated it into:

Code: Select all

Declare sub GridInstall Cdecl Alias "GridInstall"(ByVal inst As HINSTANCE)

that give me this error:

GridDemo.o:fake:(.text+0x51b): undefined reference to `GridInstall'


if I remove Cdecl I have this errors:

Warning: .drectve `-defaultlib:kernel32.lib ' unrecognized
Warning: .drectve `-defaultlib:user32.lib ' unrecognized
Warning: .drectve `-defaultlib:gdi32.lib ' unrecognized
Warning: .drectve `-defaultlib:Comctl32.lib ' unrecognized
Warning: .drectve `-defaultlib:masm32.lib ' unrecognized
Warning: .drectve `-defaultlib:\RadASM\Masm\Lib\Debug.lib ' unrecognized
C:\FreeBASIC\lib\win32/libRAGrid.a(RAGrid.obj):RAGrid.asm:(.text+0xdbc): undefined reference to `LBItemFromPt@16'
C:\FreeBASIC\lib\win32/libRAGrid.a(RAGrid.obj):RAGrid.asm:(.text+0x1848): undefined reference to `ImageList_Draw@24'
C:\FreeBASIC\lib\win32/libRAGrid.a(RAGrid.obj):RAGrid.asm:(.text+0x248e): undefined reference to `ImageList_GetIconSize@12'
C:\FreeBASIC\lib\win32/libRAGrid.a(RAGrid.obj):RAGrid.asm:(.text+0x24ba): undefined reference to `ImageList_Draw@24'
C:\FreeBASIC\lib\win32/libRAGrid.a(RAGrid.obj):RAGrid.asm:(.text+0x26ed): undefined reference to `ImageList_GetIconSize@12'
C:\FreeBASIC\lib\win32/libRAGrid.a(RAGrid.obj):RAGrid.asm:(.text+0x273d): undefined reference to `ImageList_Draw@24'

Build error(s)


Any idea?
Now I use the .dll version with the Loadlibrary function without problems

thank's in advance
wallyfblu
Posts: 69
Joined: May 24, 2006 10:58
Location: ITALY

Postby wallyfblu » May 27, 2008 11:36

I've found this in the .lib file :_GridInstall@4

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 5 guests