Page 1 of 1

How to import a PB lib while using Tailbite?

Posted: Mon Dec 17, 2007 11:09 pm
by Mistrel
I'm using a PB library imports in my project but I can't compile them to a tailbite library.

See this code, for example. It will not compile with Tailbite.

Code: Select all

Import "window.lib"
  CompilerIf #PB_Compiler_Unicode
    _PB_Window_ProcessEvent(a,b,c,d) As "_PB_Window_ProcessEvent_UNICODE@16"
  CompilerElse
    _PB_Window_ProcessEvent(a,b,c,d) As "_PB_Window_ProcessEvent@16"
  CompilerEndIf
  PB_Window_Icon
  PB_Window_Cursor
  PB_Window_Objects
  PB_Object_GetOrAllocateID(*Object,id)
EndImport

ProcedureDLL This()
	OpenWindow(0,0,0,320,240,"")
EndProcedure

Posted: Mon Dec 17, 2007 11:55 pm
by ABBKlaus
I think i got it fixed, misunderstood the problem a bit :oops:

can you test the new version and report back ?

http://www.tailbite.com/downloads/TailB ... taller.exe

Thanks,
Klaus

Posted: Tue Dec 18, 2007 2:08 am
by Mistrel
Yes, it's fixed! I wasn't expecting such a fast response. Thank you. :D

This may be beyond the scope of Tailbite but if I create a library that uses mapped procedures from a PB library but does not use a normal procedure the PB compiler does not include it with the compiled exe.

For example:

Code: Select all

Import "window.lib"
	; imports
EndImport

ProcedureDLL DLLFunction()
	; this function uses the imports
EndProcedure

; the compiler will error unless a command
; from the library is used somewhere in
; the program
Procedure NeverRun()
	WaitWindowEvent()
EndProcedure
I'm pretty certain that this is not the case with non-PB libraries.

Posted: Tue Dec 18, 2007 6:34 pm
by ABBKlaus
yes, i have no workaround for that :shock:

You have to ask fred :twisted:

Posted: Tue Dec 18, 2007 9:15 pm
by fsw
If this is a PureBasic problem then just tell the linker which lib to include...

Go to "Compiler options", then write in "Linker options File:" your linker file name.

This linker file is a normal ascii file that you can create by yourself and write linker options in it like:

/implib:filename

etc.

Hope this helps.

(sorry if I didn't understand what you are after)