Page 1 of 2

Static lib output

Posted: Mon Dec 31, 2007 11:37 pm
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.

Posted: Mon Dec 31, 2007 11:37 pm
by Dare
Yes. Agreed.

Posted: Wed Jan 02, 2008 1:08 am
by Hroudtwolf
Agreed, too.

Posted: Wed Jan 02, 2008 9:34 am
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.

Posted: Wed Jan 02, 2008 10:08 am
by Dare
Technicalities, technicalities! :)

Posted: Wed Jan 02, 2008 10:34 am
by milan1612
+1

@inc
Maybe an option if you want to compile the lib for PureBasic or
other compilers?

Posted: Wed Jan 02, 2008 12:05 pm
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.

Posted: Wed Jan 02, 2008 10:07 pm
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.

Posted: Thu Jan 03, 2008 10:12 am
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

Posted: Thu Feb 21, 2008 6:05 am
by va!n
+1 *this would be a really great feature*

Posted: Thu Feb 21, 2008 4:31 pm
by jack
but then you would have the PB command wrapper issue.

Posted: Thu Feb 21, 2008 4:45 pm
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.

Posted: Tue May 27, 2008 5:21 am
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.

Posted: Tue May 27, 2008 5:10 pm
by Dummy
This: http://www.purebasic.fr/english/viewtopic.php?t=31339
looks like a temporary solution...

Posted: Wed May 28, 2008 1:07 am
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.