Tool to import static librarys into PB

Developed or developing a new product in PureBasic? Tell the world about it.
freak
PureBasic Team
PureBasic Team
Posts: 5941
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Tool to import static librarys into PB

Post by freak »

Hi folks,

I had the idea for this quite a while ago, but never started it. Now, that
Karbon brought it back to my mind, i took some time today, and coded this.

A little tool, that let's you import a static lib (*.lib or *.obj) as a PureLibrary
into PB. So you can call them directly as PB functions. (you can even
customize the function names)

It's no big deal actually, just a little wrapper creator, but still quite usefull.
Get it at my site: http://freak.purearea.net/tools/
(make sure you read the 'readme.txt')

Consider this thing in beta stage. I haven't got that much static librarys to
properly test it. If you experience any trouble, please tell me.

Timo
quidquid Latine dictum sit altum videtur
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: Tool to import static librarys into PB

Post by NoahPhense »

freak wrote:Hi folks,

I had the idea for this quite a while ago, but never started it. Now, that
Karbon brought it back to my mind, i took some time today, and coded this.

A little tool, that let's you import a static lib (*.lib or *.obj) as a PureLibrary
into PB. So you can call them directly as PB functions. (you can even
customize the function names)

It's no big deal actually, just a little wrapper creator, but still quite usefull.
Get it at my site: http://freak.purearea.net/tools/
(make sure you read the 'readme.txt')

Consider this thing in beta stage. I haven't got that much static librarys to
properly test it. If you experience any trouble, please tell me.

Timo
Sweet..

- np
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

I just tried to import the eSellerate static lib (from the free SDK on their homepage - http://www.esellerate.net) and it just hangs after opening the "Importing Library. Please wait..." window.

It does seem to have created a small (5k) userlib.. Testing to see if it works now.
-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
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Nope, no dice :-(

I get a "eSellerate_WebStore" is not a function, array or linked list error
-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
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

This has some really awesome potential.

Many thanks!
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Hiya freak,

Tried this with the FPU.lib available with masm32.

First time hung, because I did not put () around my args in the IDE statusbar help field.

Second time created the library FPU, which I put into the userlibraries folder. I closed all pbeditor windows, reopened, and tried.

Same result as Karbon - "realXadd is not a function, array or linked list" where realXadd is the alias for fpuAdd. Same result using fpuAdd.

OS is win2000pro, all SP and updates in place.

Hope this is a small fix as having this will really rock!
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Nice idea!!!!

Im testing this tool that converts ANY dll into a lib:

http://www.binary-soft.com/dll2lib/dll2lib.htm

I convert the dynaload into a lib and will try to test with it.

At the moment im trying to use your tool but it seams to freeze (i will wait a little more)...

BTW, where does ned to point the LibMaker Path? To lib sdk?

:P
ARGENTINA WORLD CHAMPION
PolyVector
Enthusiast
Enthusiast
Posts: 499
Joined: Wed Sep 17, 2003 9:17 pm
Location: Southern California
Contact:

Post by PolyVector »

Freak... I have some code for ya:

Code: Select all

If FreakFinishesThisProg
    PayFreak($FFFF)
Else
    PayFreak(#NULL)
EndIf
freak
PureBasic Team
PureBasic Team
Posts: 5941
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

I have uploaded a new version with a few changes ( http://freak.purearea.net/tools/ )
It now outputs the current status, so you'll know where it hangs (most probably when calling Librarymaker.exe)
I added also some more checks to prevent the QuickHelp problems.

If you can't make it work for a specific lib, provide me with a download link,
and i'll try if there is a bug in my tool. Works find for me so far.
See below for a detailed example of usage.

Note: If you only get one PureLib created, then there is something wrong.
You need to have one called like the original file (just no extension), and
one with the same name, but "_wrapper" behind it.
Both are required (one contains the PB functions, the other the real lib)

Karbon:
Sorry, i can't test your lib. They want me to register just to get the demo,
and i don't like that much. Maybe the information below helps a bit.

Dare2
I downloaded masm32 from the net, and converted the lib wihout any
trouble.
Here is a detailed description of what i did:

download url:
http://www.masm32.com/masmdl.htm

Paths:
PBCompiler = C:\PureBasic\Compilers\
LibraryMaker = C:\PureBasic\Library SDK\
UserLibraries = C:\PureBasic\PureLibraries\UserLibraries\
Temp = B:\ (this is my ramdisk)

Note: the first needs to be the path where Fasm.exe is located (PB compilers path)
the second needs to be where the LibraryMaker.exe tool is located (Library SDK)
the next is the output directory
the last should be a temp directory. Make sure, there are no other .desc
files in that directory. Otherwise the LibraryMaker thinks, these need to be
converted too, and probably hangs.

Source File: C:\masm32\LIB\fpu.lib

Functions:
original name: FpuAdd
alias: realXadd
parameters: 4

original name: FpuFLtoA
alias: realXstr
parameters: 4

Is just used "()" as quickhelp for now.

When converting, i get the 2 files:
Fpu
Fpu_wrapper

After restarting PB, the following code worked fine:

Code: Select all

realXadd(123, 321, 0, 8|2048|128)
result$ = Space(25)
realXstr(0, 5, @result$, 1|2048)
Debug result$
I hope this helps a bit. If you can't make it work, please tell me exactly
what you did.

ricardo
the LibMaker Path needs to point to the LibraryMaker.exe tool in the
PB LibrarySDK folder.


That's it..

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 »

http://www.esellerate.net/downloads/eSellerateSDK.exe <- direct download

I'll try the newest version tonight.. Thanks!
-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
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Hi Freak,

Thanks for that.
I downloaded masm32 from the net, and converted the lib wihout any trouble.

That is one big download. 8O I should have given a link to just the fpu.lib, sorry. But there are heaps of goodies in the masm package, so I hope that offsets the effort you went to. Appreciate that.

My original error was ( :oops: ) I did not copy the wrapper part into the userlibrary folder (I set destination to a temp directory under that folder, and just copied up 1 file, fpu).

Will get your newest version and start playing. A whole new world has opened up!

I am one happy chappy! :D :D :D
freak
PureBasic Team
PureBasic Team
Posts: 5941
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Dare2 wrote:That is one big download. 8O I should have given a link to just the fpu.lib, sorry. But there are heaps of goodies in the masm package, so I hope that offsets the effort you went to. Appreciate that.
No problem, only took about a minute on broadband. 8)

> I am one happy chappy! :D :D :D

Nice to hear :)


Karbon:
I had a look at the thing, and it seems to convert fine,
However, this stuff is a bit complex, so i can't quickly test it now.


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 »

No worries. As long as it didn't hang on you I'll try it tonight and report back to you if it fails..

THANKS!
-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
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Hi,

I use your app for the dynaload.lib, i get the lib on my users lib.. but when try to run it get the next error message for every function:

1.obj.text: undefinded reference to '_DL_LoadLibrary@8'

I found the wrapper, but its only 1 k and the lib is 24 k.


Thanks in advance!!

The lib: http://www.getafile.com/cgi-bin/merlot/ ... YNLOAD.zip
ARGENTINA WORLD CHAMPION
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

WOW!

Nice one!

Freak, i'll vote for you for President !!!
Post Reply