PBI or LIB or user libraries...

Just starting out? Need help? Post your questions and find answers here.
kruddick
User
User
Posts: 11
Joined: Mon Mar 08, 2004 1:15 am

PBI or LIB or user libraries...

Post by kruddick »

Can someone help me out with some questions about user created libraries?

How do you make these libraries? Any examples would be good.

Do they always end in PBI? Just stick them in the userlib folder and they work? Or do you need to initialize them? Do you need an include statement to get them to be recognized by your program? I guess I need to know how to call them.

Any help is appreciated.

Thanks
Kent
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Libraries are generally coded for Purebasic in either assembly language or C. Someone will correct me here if I am wrong, but .pbi files typically contain little more than constants, procedure declarations etc.

Installing a library is very straight forward:
i) Copy the main library file into your Purebasic\PureLibraries\UserLibraries folder.
ii) Copy any resident files (.res) into the residents folder,
iii) copy any help files into the help folder.

That's it. Next time you run PB, the new commands / help files etc. will be available.

The actual technicalities of writing a library is beyond me at the moment but I believe that El-Choni has recently released a piece of code which allows user libraries to be coded in Purebasic. Check out the Pure project site.
Many people who have written user libraries include source code with their kind offerings and so you might be able to get some idea of what coding a library in assembly language involves.
I may look like a mule, but I'm not a complete ass.
kruddick
User
User
Posts: 11
Joined: Mon Mar 08, 2004 1:15 am

Post by kruddick »

Thanks srod.

I've been trying to user the header converter in the sdk to get access to the powrprof.h structures. I used freaks lib converter on the library powrprof.lib

I get 3.obj.text: undefined reference to '_SetActivePwrScheme@12'
.
.
.

etc.

Not sure what I am doing wrong at this point.

Kent
Post Reply