Page 1 of 1

Madshi and Lazarus?

Posted: Sat Oct 17, 2009 1:00 pm
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:

Posted: Mon Oct 19, 2009 6:56 am
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.

Posted: Wed Oct 21, 2009 2:01 pm
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

Posted: Wed Oct 21, 2009 3:50 pm
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".

Posted: Wed Oct 28, 2009 4:56 pm
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:

Posted: Wed Oct 28, 2009 7:50 pm
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...

Posted: Tue Nov 10, 2009 9:58 pm
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:

Posted: Mon Nov 16, 2009 6:16 pm
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.