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 »

Look 3 posts up for the coffIT link.
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 »

srod...
its not working for me.
Im using PB4.2 Final and yur latest Coffit...
Send yu PM with whole code!
cheers eNerGy
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Well, coffIT works fine here on the entire program you sent me (on XP and Vista).

The only thing I will say is that you haven't followed the 'rule' where comments are concerned!!! You need to read the instructions for that. Still, I would expect any problem with this to be reflected on my system.

Now what you need to do is get coffIT to create a log file and then send me a copy of that file (after coffIT fails to work) as well as a copy of the error message being produced. If it is a Fasm message then it should detail the exact asm instruction which is playing silly buggers! :) In this case I would have to ask which version of Fasm your installation is using? I have chopped and changed mine around so much that I could well be using a different version than you!
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 »

Okay - problem sorted!!!

CoffIT prepends the name of the source file being worked on to all symbols being made public for the sake of sharing amongst all the different .obj files. If your source file name contains some weird characters then FASM may well blow a gasket or two! You've been warned! :wink:
I may look like a mule, but I'm not a complete ass.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Using CoffIT 2 beta 1 for PB 4.3 downloaded from nxSoftware today, I played with it a bit on WinXP / PureBasic 4.3 final and tried a couple of examples. All went fine until suddenly CoffIT lost the capacity to find the Purebasic compiler. Now no matter what I try every time I execute CoffIT I get a messagebox saying "Cannot locate Purebasic Compiler". I've reinstalled PB, re-unzipped CoffIT into a clean folder, restarted the computer, added the Purebasic\compilers folder into my global PATH, put CoffIT.exe in the same folder with PBCompiler.exe, nothing helps at all.
BERESHEIT
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Yes I think I encountered this a few days ago and fixed it; I haven't gotten around to uploading the fix though. Seems to be a registry issue. Let me upload a new version for PB 4.3......
I may look like a mule, but I'm not a complete ass.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Would it be possible for CoffIT, upon failing to find the path, to ask me for it as an alternative to shooting me in the head with a messagebox?
BERESHEIT
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

netmaestro wrote:Would it be possible for CoffIT, upon failing to find the path, to ask me for it as an alternative to shooting me in the head with a messagebox?
Haven't time to work on CoffIT at the moment I'm afraid so the answer has to be no, even for what is a minor request - sorry.

Try downloading the PB 4.3 version now netmaestro. See if that works?

**EDIT : are you using XP or Vista?
I may look like a mule, but I'm not a complete ass.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Thanks, tried the new version and it works. Using XP.
BERESHEIT
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

netmaestro wrote:Thanks, tried the new version and it works. Using XP.
Yes it was on XP that the problem arose. It would seem that PB 4.3 placed it's registry entries into a different key; at least a key that was different for XP. My code for retrieving the PB path was simply a little out of date! :)
I may look like a mule, but I'm not a complete ass.
Justin
Addict
Addict
Posts: 948
Joined: Sat Apr 26, 2003 2:49 pm

Post by Justin »

This seems a great tool, i've never used static libs. Can someone post the steps to use it in Visual C++?
I include the .lib in the project and put a declaration for the function but it says unresolved external function.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Have you read the CoffIT manual?

If not, then it explains the pitfalls of attempting to use an MSCOFF object file created by Purebasic with another programming language.

Basically, if you wish to do this then you have to avoid using any Purebasic commands which reside in a PB external library. For example, if your code uses Purebasic's Random() function, then any .obj/.lib file you create will not carry to other development tools unless you also carry across PB's 'misc' user library because this is where the code for the Random() function sits. Now, PB's user-libraries are not standard COFF files and so you are stuck because it is not possible to extract the COFF file containg the Random() function.

If you avoid such dependencies then it is possible to carry across your CoffIT created object files to other development tools. I have done this with some simple ASM projects. Visual c++ is a different animal though!
I may look like a mule, but I'm not a complete ass.
Justin
Addict
Addict
Posts: 948
Joined: Sat Apr 26, 2003 2:49 pm

Post by Justin »

Yes i read the manual :D , i don't plan to use pb library commands.

I just tried the Incremental.pb example, copied the lib into my project and added it among with a header file containing the function declaration.
Then i set the MS Compiler to compile the lib in the lib properties,( i have no idea of what switchwes to use), then i build the project and said unresolved external symbol when compiling the lib.

I wonder if you or anyone has succeded doing this or i'm missing something.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

I used that very example in an ASM project for a test (using GoASM). It was quite a while ago now I must admit, but it worked fine.
I may look like a mule, but I'm not a complete ass.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

I noticed in the PB 4.3 version of the coffIT help file, in the 'Exporting Functions' section, you use this example:

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
For PB 4.3, should that not be: ProcedureDLL.i instead of .l ?

(the .l is used in other examples also in the help)
Post Reply