Madshi and Lazarus?

delphi package - madRes, madTools, madStrings, ...
Post Reply
gonzo
Posts: 4
Joined: Sat Oct 17, 2009 12:56 pm

Madshi and Lazarus?

Post by gonzo »

Hi all
How can i use Madshi with free object pascal compiler Lazarus?
Please help me :sorry:

EDIT:

Error after compilation:
http://img18.imageshack.us/i/coded.jpg/

Next i do this:
http://img5.imageshack.us/i/code2n.jpg/

Error after compilation:
http://img291.imageshack.us/i/code3x.jpg/

What is wrong? How can i do this? Please help me :cry:
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Seems that Lazarus can't find madRes.pas. Don't know why. Check the Lazarus paths. The file should be there. About the madTypes.pas complaint: Did you edit madTypes.pas somehow? Lazarus complains about line 80 redefining TAString. But line 80 doesn't contain TAString, it contains TAWideString.
gonzo
Posts: 4
Joined: Sat Oct 17, 2009 12:56 pm

Post by gonzo »

"Seems that Lazarus can't find madRes.pas. Don't know why. Check the Lazarus paths. The file should be there."

To which path to copy madRes.pas? Just copying the folder with my project.


"About the madTypes.pas complaint: Did you edit madTypes.pas somehow? Lazarus complains about line 80 redefining TAString. But line 80 doesn't contain TAString, it contains TAWideString."

Yes, I tried. Original madTypes.pas now copied to the folder of my project and compiled:

http://img202.imageshack.us/i/error123321.jpg/

Thank you for your reply
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

gonzo wrote:To which path to copy madRes.pas?
I don't really know. I've no experience with Lazarus. I don't know where it expects the source code. Maybe the easiest way out would be to copy madRes.pas to your project folder.
gonzo wrote:Yes, I tried. Original madTypes.pas now copied to the folder of my project and compiled: [...]
I think that's a bug in Lazarus. But anyway, you can probably work around that by changing the "shr 2" to "shr 3" or "shr 4".
gonzo
Posts: 4
Joined: Sat Oct 17, 2009 12:56 pm

Post by gonzo »

gonzo wrote:Yes, I tried. Original madTypes.pas now copied to the folder of my project and compiled: [...]
I think that's a bug in Lazarus. But anyway, you can probably work around that by changing the "shr 2" to "shr 3" or "shr 4".[/quote]

I change:
" TAString = array [0..maxInt shr 2-1] of string;"
to:
" TAString = array [0..maxInt shr 3-1] of string;"
and

" TAString = array [0..maxInt shr 4-1] of string;"

And isn't work "madTypes.pas(78,56) Error: Data element too large
" :sorry:
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Well, then simply replace it with "array [0..100000]" or something. In the worst case you can replace it with "array [0..0]". The reason why madTypes tries to define the arrays as large as possible is that this way you can avoid superfluous compiler warnings when doing pointer math with these types...
gonzo
Posts: 4
Joined: Sat Oct 17, 2009 12:56 pm

Post by gonzo »

It's still wrong :? Can u tell me, is Turbo Delphi compatible with madshi? Maybe U know that ? Sorry for my bad English :confused:
madshi
Site Admin
Posts: 10338
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

The free Turbo Delphi edition doesn't accept any 3rd party precompiled DCUs, so it's not compatible with the commercial madCollection packages. You could manually recompile the freeware madCollection packages with the free Turbo Delphi edition, though.
Post Reply