Add the creation of static libraries (lib) and drives (sys)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User_Russian
Addict
Addict
Posts: 1519
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Add the creation of static libraries (lib) and drives (sys)

Post by User_Russian »

Offered to add the creation of static library (lib), the object files (obj) and drivers (sys) at least in the Windows version.
If you can create a dynamic library (dll), then I think that does not have any problems with the creation of static (lib).
Drivers kernel mode (sys) can be created using slightly modified PureBasic. http://www.purebasic.fr/english/viewtop ... 14&t=49195
Why then is not officially add this feature in PureBasic?
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Add the creation of static libraries (lib) and drives (s

Post by idle »

+1 for static libs
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Add the creation of static libraries (lib) and drives (s

Post by ts-soft »

The problem with static libs is, all pb functions are included
and usable by any other user, without a license of PB.
If the lib doesn't include the pb functions, he works only
with PB and this makes no sense for me.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Re: Add the creation of static libraries (lib) and drives (s

Post by jack »

yes, but that also applies to DLL's, except you have the telltale of the DLL in the package.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Add the creation of static libraries (lib) and drives (s

Post by ts-soft »

In a DLL i can see only exported functions, in a static lib i can see and use all functions.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Add the creation of static libraries (lib) and drives (s

Post by IdeasVacuum »

In a DLL i can see only exported functions, in a static lib i can see and use all functions.
Wouldn't it be possible to output a static lib that only matched the DLL functions?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Add the creation of static libraries (lib) and drives (s

Post by ts-soft »

You can easy dump all symbols, not only exported symbols!
You can use PODUMP or POLIB. I use a Plugin for TotalCommander.
There is no way to hide the symbols in a static lib.
You can extract what ever you requires from lib with explode.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Add the creation of static libraries (lib) and drives (s

Post by skywalk »

How does PowerBasic create static libs? They are notorious defenders of the bottom line...
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Add the creation of static libraries (lib) and drives (s

Post by ts-soft »

I think PowerBasic uses only API and no Libs, like PureBasic does.
FreeBasic for example requires libbfd.a as own lib. In a Freeware
no problem.
PB requires some libs (the libs in pb and the userlibs are all static libs, only compressed),
stringmanager and so on. A static lib, create with pb, without the stringmanager can
not use any string :wink:
This have nothing to do with notorious defenders :lol:

TailBite creates Static Libs, but without including the Libs from PB.
This libs doesn't work in other languages, so this is available but
useless.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Re: Add the creation of static libraries (lib) and drives (s

Post by jack »

there's an application that converts DLL's to static lib's http://www.binary-soft.com/dll2lib/dll2lib.htm but way too expensive, Sapero from the ionic wind forums had a free utility to convert a DLL into a static lib, but I never tried it and don't know how good it was.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: Add the creation of static libraries (lib) and drives (s

Post by gnozal »

skywalk wrote:How does PowerBasic create static libs? They are notorious defenders of the bottom line...
Iirc, Powerbasic static libs (SLL) are only usable with Powerbasic.
These are not standard COFF lib files.
jack wrote:...Sapero from the ionic wind forums had a free utility to convert a DLL into a static lib, but I never tried it and don't know how good it was.
I think it was a sort a DLL loader from memory, like Joachim Bauch's tools, and not a real converter.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Add the creation of static libraries (lib) and drives (s

Post by skywalk »

If I only want to use the lib in PB?
Is Tailbite documented and approved by PureBasic license?
I can see advantage of reducing code required to compile while debugging.
But I don't want to use a static lib if the process is unsupported.
It should be native.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Add the creation of static libraries (lib) and drives (s

Post by DarkDragon »

Obfuscation would be a solution: when compiling the static lib, rename all pb internal symbols to something random. Besides this, there must be some kind of export table which you can modify, even for libs.
bye,
Daniel
xorc1zt
Enthusiast
Enthusiast
Posts: 276
Joined: Sat Jul 09, 2011 7:57 am

Re: Add the creation of static libraries (lib) and drives (s

Post by xorc1zt »

purebasic compile the code as one object, very annoying to produce a decent lib.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Add the creation of static libraries (lib) and drives (s

Post by ts-soft »

xorc1zt wrote:purebasic compile the code as one object, very annoying to produce a decent lib.
This is not correct, pblibs and userlibs a splittet in many objects.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Post Reply