coffIT - create obj and lib static libraries from PB source!

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

28/2/2008. Bug fix.
coffIT would crash out if the linker complained with an error when compiling a source file to a .obj file. An absurd thing to do when you think about it! Doh! :roll:

Have also added an example of how to use coffIT in conjunction with POLIB to create a static .lib file from multiple object files.
coffIT version 2 will do this automatically, but in the mean time ......

Download coffIT


@Milan : I've included a text file along with the new example giving step by step instructions on how to recreate the .lib file etc.
I may look like a mule, but I'm not a complete ass.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Very nice program. Thank you for adding another power-tool to PB :).
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

29/02/2008. Update - coffIT 1.0 beta 2.
In the event of a successful compilation, coffIT generated log files will now list all external functions / symbols required by the resulting .obj or .lib file etc.
This is useful when hoping to use your resulting static library in other programming languages etc.

This is on top of the coffIT generated Purebasic import wrappers which will list all Windows libraries required by the .lib etc.

Download coffIT

===================================

*EDIT : you're welcome Info. :)
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

04/03/2008. Update - coffIT 2.0 beta 1.
coffIT now offers MSCOFF .obj or MSCOFF static library (.lib) output formats.

I advise reading the relevant parts of the help manual regarding the choice of creating .obj or .lib files, because it is worth understanding how coffIT proceeds here as well as the reason why I would not necessarily suggest using .lib files!

Download coffIT
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

works fine, thank you :D

ps: only the ide-integration doesn't work, if there no other item!

greetings
Thomas
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
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

ts-soft wrote:ps: only the ide-integration doesn't work, if there no other item!

greetings
Thomas
Bugger - didn't think about that! DOH!

I'll fix it now.

Thanks. :)

**EDIT : does this mean you're back?
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Thomas, I removed all tools from my IDE menu - restarted the IDE and coffIT integrated itself fine!

Ah, unless... Have you ever had tools added to the IDE since you last updated?
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Fixed (I think!)

:)
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

srod wrote: **EDIT : does this mean you're back?
Only my new PC works like a charm but i'm waiting for DSL

greetings
Thomas
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
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

So to avoid missing libraries you could code this right ?

(It's a very bad example i know)

Code: Select all

ProcedureDLL.l  Rnd(value)
  Protected a = Random(value)  ;Here we use a command from PB's misc user library.
  ProcedureReturn a
EndProcedure 

Import "misc.lib"
 EndImport
In this specific example I guess the PB license is violated (at least when wrapping it's internal libraries) or am i wrong ?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Well, such a static library (unlike a dll) would only be useable in a Purebasic application anyhow (because of the reliance on PB's Misc library) and so, in a sense, I don't suppose the PB licence is being broken on this occasion. :) It's a fine line!

The following would be okay however since it is not a simple wrapper around the Random function: :wink:

Code: Select all

ProcedureDLL.l  Rnd(value) 
  Protected a = Random(value)  ;Here we use a command from PB's misc user library. 
  a + 1
  ProcedureReturn a 
EndProcedure 
Again though, only useable in a PB application anyhow because of the reliance on the Misc user library which other languages have no access to.

By the way, you cannot directly import Purebasic's Misc library using the Import / EndImport commands as the library itself is embedded within the 'Misc' user library. coffIT's generated PB wrapper imports it indirectly by creating some dummy code.
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

09/03/2008. Bugfix.
When creating a static .lib, coffIT (more precisely, Fasm!) would crash out if a 'Data' statement contained repeated addresses of the same procedure.

Download coffIT
I may look like a mule, but I'm not a complete ass.
energy
User
User
Posts: 19
Joined: Sat Aug 04, 2007 1:05 pm
Location: Germany

Post by energy »

CoffiT reported:
Illegal Intsruction in the following Procedure:
Anyone knows why?
Thnax in forward...

Code: Select all

Procedure UpdateSampleDelta(nexttime.l, time.l, usecs.l, td2.l, *smplrem.Long, *smpldelta.Long) 
  ; performs 64bit (nexttime-time)*usecs/td2 And a 32.32bit addition To smpldelta:smplrem 
  !MOV Eax, [p.v_nexttime] 
  !SUB Eax, [p.v_time] 
  !MOV Ebx, [p.v_usecs] 
  !MUL Ebx 
  !MOV Ebx, [p.v_td2] 
  !DIV Ebx 
  !MOV Ecx, [p.p_smplrem] 
  !ADD [Ecx], Edx 
  !ADC Eax, 0 
  !MOV Ecx, [p.p_smpldelta] 
  !MOV [Ecx], Eax 
EndProcedure 

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

Post by srod »

Works fine here.

Which version of PB are you using and are you using the latest version of coffIT?
I may look like a mule, but I'm not a complete ass.
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

srod, I went to your website but the link for coffIT is invalid as are the links for Freeware, Tutorials, Links, EasyVENT, nxResize, nxScribe and Subclassing.
Post Reply