Tool to import static librarys into PB

Developed or developing a new product in PureBasic? Tell the world about it.
Iria
User
User
Posts: 43
Joined: Sat Nov 29, 2003 8:49 pm

Hmm..

Post by Iria »

Hiya,

First off can someone tell me if Im correct in thinking:

My understanding of a static library, is a library that is built statically so that programs that use functions within the library, when being linked pull the object code from the static library into the executable program.

This makes executables large (as they now include the library function object code) and programs run with the versions of library functions they were compiled/linked with?

Ok if the above is correct...can you help me out on my questions :)

Most windows libraries are of the dynamic sort?

If I have a library which is dynamic I cannot use this tool to link it in as its not the right sort?

Is there a way of making the DLL static other than recompiling as a static library?

Does anyone have a good location for static libraries that I can go play with :)

Finally would this tool work with Linux static libraries?

Phew..

Hope you can help :)
freak
PureBasic Team
PureBasic Team
Posts: 5941
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

ricardo:
I'm afraid, i have some bad news. The whole thing only works with .lib
files, that are compatible to lcclink. (because that is what PB uses to link
the final exe)
I couldn't get it to work with your lib either, so i guess it's one of those
who are not compatible.

Iria:
Yes, what you say on top is correct.

> Most windows libraries are of the dynamic sort?
Yes, those are dlls. Windows programs make lot's of use of them.

> If I have a library which is dynamic I cannot use this tool to link it in as its not the right sort?
nope.

> Is there a way of making the DLL static other than recompiling as a static library?
See one of ricardo's earlier posts, he linked to a tool, that can make a
.lib out of a dll.
I can't test if it works with my tool though.

> Does anyone have a good location for static libraries that I can go play with
Well, the masm32 package mentioned above does have some, but i didn't
play around with them yet.
Some dll projects (like zlib for example) also do provide a static library,
you'll just have to search for them.

> Finally would this tool work with Linux static libraries?
I don't think so.

I don't have enough knowledge to create such a tool for linux. :cry:

Timo
quidquid Latine dictum sit altum videtur
Iria
User
User
Posts: 43
Joined: Sat Nov 29, 2003 8:49 pm

Cheers

Post by Iria »

Thanks for the reply :)

More importantly thanks for the tool :) WHOOP!
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

..

Post by NoahPhense »

[edited]

:cry:
Last edited by NoahPhense on Fri Mar 05, 2004 3:32 am, edited 1 time in total.
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

general question

Post by NoahPhense »

Timo,

General question, if you can answer it..

That library file (in the compilers directory) that is created when
we make a standard PureBasic DLL. Can that be used with any
language?

- john
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

NoahPhense, thanks for that info!

* whistles a happy tune *
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

freak wrote:ricardo:
I'm afraid, i have some bad news. The whole thing only works with .lib
files, that are compatible to lcclink. (because that is what PB uses to link
the final exe)
I couldn't get it to work with your lib either, so i guess it's one of those
who are not compatible.
There are not any workaround this?
ARGENTINA WORLD CHAMPION
freak
PureBasic Team
PureBasic Team
Posts: 5941
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

NoahPhense:
It doesn't work the way you try it. sorry.

The Purebasic.lib file created when making a dll is not static library. It is,
what is called an import library. These are librarys, that only contain
functions to call the real dll through early binding. (this means, the dll is
loaded at the start of the program, you don't have to call a command for that.

So these libs are basically just wrappers to the dll, so you can call them easier.
(the PureBasic.lib file is intended to be used with other languages to easily
access the dll)

So... what you just created with my tool is a wrapper of a wrapper of the dll.
(try to remove the created dll from the compilers directory, and it should stop working.)

You should use El_Choni's tool to create PB libs out of your own code. Mine
is intended to import 3rd party libs, where you don't have a source.

(btw: nice red colors (err brown) . I guess i'll use white from now on :P )

ricardo:
i'm still on it. I'm not even sure, if your lib is really incompatible, or if there
is a way around. I'll keep looking.
I'm just very short on free time, so it might take a while


Timo
quidquid Latine dictum sit altum videtur
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Hi all...

Just found this little shareware that converts DLL into Static Libs !!!

I'm performing test now to see if it works fine with Fr34k proggy :P

http://www.binary-soft.com/dll2lib/d2l.exe
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Num3 wrote:Hi all...

Just found this little shareware that converts DLL into Static Libs !!!

I'm performing test now to see if it works fine with Fr34k proggy :P

http://www.binary-soft.com/dll2lib/d2l.exe
I reference it at the beggining of this post thread and try to test the tool, but fails and Freak answer me that maybe the libs are incompatible :cry:

I hope he find some workaround!!
ARGENTINA WORLD CHAMPION
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Freak, any hope that you'll make this work with the new linker? :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
freak
PureBasic Team
PureBasic Team
Posts: 5941
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

umm...oh... didn't even try that with the new linker yet... :roll:

I'll see what can be done.

Timo
quidquid Latine dictum sit altum videtur
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Motivation : All the beer you can drink.. Just add it to Fred's tab.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Max.
Enthusiast
Enthusiast
Posts: 225
Joined: Fri Apr 25, 2003 8:39 pm

Post by Max. »

@ Freak

Great idea and excellent work. I did a (very short) test with the iSEDQuickPDF Library and it seems as if it works well!

A small request, if you don't mind...

...is it possible to add a kind of project handling, allowing one to save the functions and load them later again to add functions or edit descriptions? It would also make it easy to exchange the definitions amongst users, while sharing the User Libraries might sometimes not be possible due to legal reasons.
Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

SedTech is also distributing a PureBasic file with all the functions defined.. Check out the distro zip..
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Post Reply