[Implemented] Easier linking of external libraries

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

[Implemented] Easier linking of external libraries

Post 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 ;)
Good programmers don't comment their code. It was hard to write, should be hard to read.
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

I second Traumatics request, it would be very useful indeed.
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

bit difficult for OOP Libs?
--Kale

Image
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

What are "OOP libs" ?
Good programmers don't comment their code. It was hard to write, should be hard to read.
Bonne_den_kule
Addict
Addict
Posts: 841
Joined: Mon Jun 07, 2004 7:10 pm

Post by Bonne_den_kule »

OOP=Object Oriented Programing
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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.
@}--`--,-- A rose by any other name ..
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Import "YourFavoriteLib.lib"
Function1.l(a.l) [As "_xxx@8" - StdCall/CDLEC ?]
..
EndImport
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I want that !!!!!!!!!!!!!!!! :wink:
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post 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...
Good programmers don't comment their code. It was hard to write, should be hard to read.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

And then of course, you will have to help El Chroni, because such a feature MUST be included in TailBite too 8)
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

I'll do my homework, including updating TailBite when it's needed without bothering Fred (I hope) :wink:
El_Choni
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post 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 !!
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post by Blade »

And the option to include that library in the final exe is possible?
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post 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 :)
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Fred, without trying to be pushy, can you tell us for what release this feature is planned?
Good programmers don't comment their code. It was hard to write, should be hard to read.
Post Reply