Page 1 of 2

[Implemented] Easier linking of external libraries

Posted: Thu May 26, 2005 8:52 am
by traumatic
This has been discussed some times before but never made its way into
the feature requests IIRC.

It would be nice to ease the linking of external libraries, especially now
that PureBasic (POLINK) supports COFF.

Something like:

Code: Select all

Extern "_foo@8" In "bar.lib" As "Foo(a.l, b.f)"
Don't know about the syntax ;)

Posted: Thu May 26, 2005 2:13 pm
by dell_jockey
I second Traumatics request, it would be very useful indeed.

Posted: Thu May 26, 2005 4:16 pm
by Kale
bit difficult for OOP Libs?

Posted: Thu May 26, 2005 4:20 pm
by traumatic
What are "OOP libs" ?

Posted: Thu May 26, 2005 5:09 pm
by Bonne_den_kule
OOP=Object Oriented Programing

Posted: Thu May 26, 2005 5:24 pm
by Fred
It's a good idea. Something like this ? Any input is welcome.

Code: Select all

Import "YourFavoriteLib.lib"
  Function1.l(a.l) [As "_xxx@8" - StdCall/CDLEC ?]
  ..
EndImport

Posted: Thu May 26, 2005 5:41 pm
by Dare2
How about:

Code: Select all

LinkWith "path\file.obj"

  CallType  functionName[.type]  [par1.type  [, par2.typ ...]]

eg

  CallStd  DoTaskA.l   a.l, a.l, a.w          ; this returns a long
  CallStd  DoTaskB     a.s, a.l, a.b          ; this returns nix
  CallC    DoTaskC.w  a.f                     ; this returns a word

EndLink
If you implement this sort of thing then your choice of a platonic *kissy kissy* or not.

Posted: Thu May 26, 2005 6:08 pm
by Polo
Import "YourFavoriteLib.lib"
Function1.l(a.l) [As "_xxx@8" - StdCall/CDLEC ?]
..
EndImport
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I want that !!!!!!!!!!!!!!!! :wink:

Posted: Thu May 26, 2005 6:42 pm
by traumatic
Fred wrote:

Code: Select all

Import "YourFavoriteLib.lib"
  Function1.l(a.l) [As "_xxx@8" - StdCall/CDLEC ?]
  ..
EndImport
Perfect IMHO! :D
(err... this would crash btw ;))


Bonne_den_kule:
I know what OOP is, yet don't know what "OOP libs" are supposed to be...

Posted: Thu May 26, 2005 7:40 pm
by Polo
And then of course, you will have to help El Chroni, because such a feature MUST be included in TailBite too 8)

Posted: Thu May 26, 2005 8:09 pm
by El_Choni
I'll do my homework, including updating TailBite when it's needed without bothering Fred (I hope) :wink:

Posted: Thu May 26, 2005 8:14 pm
by Polo
Then it's even better, Tailbite is so good !
Althought, if Fred was agreeing to translate Tailbite to make it into pbcompiler, it would be even better, we would have Userlibraries making ability in Windows/Linux/Mac !!

Posted: Thu May 26, 2005 8:37 pm
by Blade
And the option to include that library in the final exe is possible?

Posted: Thu May 26, 2005 8:39 pm
by Polo
Blade wrote:And the option to include that library in the final exe is possible?
Well, this is what this thread is about :)

Posted: Sun May 29, 2005 4:20 pm
by traumatic
Fred, without trying to be pushy, can you tell us for what release this feature is planned?