Static lib output

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Static lib output

Post by Mistrel »

I know that PureBasic outputs a .dll with a import .lib. It would be a great addition if PureBasic could output a static lib.
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

Yes. Agreed.
Dare2 cut down to size
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Agreed, too.
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

The final User of your static lib would be forced to link (in VC++ i.e.) with the needed PB libs where commands have been used from (like Window, 2DDrawing etc). But as the Purebasic Libs are protected thats not possible.
Maybe that could be handled by an internal progress of PB where those needed PB library symbols would be linked/appended directly before outputting the final static lib.
Check out OOP support for PB here!
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

Technicalities, technicalities! :)
Dare2 cut down to size
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

+1

@inc
Maybe an option if you want to compile the lib for PureBasic or
other compilers?
Windows 7 & PureBasic 4.4
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

milan1612 wrote:Maybe an option if you want to compile the lib for PureBasic
Could already exactly be done via -> Tailbite :-)
or other compilers?
yep, as told, then the PB library symbols have to be embedded in the resulting static lib. Else VC++ compiles would be end up in linking errors.
Check out OOP support for PB here!
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

inc. wrote:
milan1612 wrote:Maybe an option if you want to compile the lib for PureBasic
Could already exactly be done via -> Tailbite :-)
or other compilers?
Tailbite builds only PureBasic libraries.
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Yes and if you would look closer than you will recognise that my statement belongs to one of Milans Ideas:
Maybe an option if you want to compile the lib for PureBasic
Check out OOP support for PB here!
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

+1 *this would be a really great feature*
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
jack
Addict
Addict
Posts: 1336
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

but then you would have the PB command wrapper issue.
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post by localmotion34 »

jack wrote:but then you would have the PB command wrapper issue.
It wouldnt be all that difficult to decide on a set of limited commands that are allowed to be used in a static lib.

When the "static lib" output option is selected, the compiler will only look for PB libraries in a special folder designed for static lib output. when it encounters a command not allowed in a static lib, it just behaves like the PB demo does "thisprocedure() is not a function array or linked list".

All the win API commands, some math functions, string manipulation could be allowed. it is up to Fred really, but there is a way to do it and be fair to everyone.

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

I would still love to see this added as a feature for PureBasic. It would be an obvious solution to the inherit problems that exist with TailBite and future compatibility. PureBasic can already export to a DLL but this is not always an acceptable solution.
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

This: http://www.purebasic.fr/english/viewtopic.php?t=31339
looks like a temporary solution...
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Dummy wrote:This: http://www.purebasic.fr/english/viewtopic.php?t=31339
looks like a temporary solution...
Libraries produced by coffIT cannot be used in other languages if they use any function from the PureBasic libraries. It's still a PureBasic-only solution, like TailBite.
Post Reply