Re: [fpc-pascal] Error: Identifier not found "Heap Error"

2016-10-15 Thread Michael Van Canneyt



On Sat, 15 Oct 2016, Luiz Gonzaga de Oliveira Neto wrote:


Hello all,

As mentioned in a previous e-mail, I'm having my first contact with Pascal
during my Masters research, trying to compile a code provided by a
professor.

The first mistakes I had regarded the *memavail *and *maxavail* functions,
which I've read are not supported anymore. I believe I have overcome these
issues, but I still get the following error:

OPTIQAP.PAS(18,21) Error: Identifier not found "HeapError"
OPTIQAP.PAS(19,6) Error: Identifier not found "HeapError"

As I mentioned in the previous e-mail, this code was provided by me by a
reputed professor, so I have reasons to believe it's correct. My question
is: do you know if this error could be happening due to some version
incompatibility or some missing flag during compilation? Or is it probably
caused by some mistake in the code? Or would you need more information to
answer this?

Sorry if the question is silly, as I've mentioned, this is my first contact
with Pascal and FPC.


This is possibly code intended for Turbo Pascal. 
The HeapError identifier does not exist in Free Pascal. 
At least, I have not found any.


In some old Free Vision code, I found a reference to HeapError which seems
to be a callback function variable, but it is not active for Free Pascal. 
I suggest you simply remove any lines that contain HeapError.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Error: Identifier not found "Heap Error"

2016-10-15 Thread Luiz Gonzaga de Oliveira Neto
Hello all,

As mentioned in a previous e-mail, I'm having my first contact with Pascal
during my Masters research, trying to compile a code provided by a
professor.

The first mistakes I had regarded the *memavail *and *maxavail* functions,
which I've read are not supported anymore. I believe I have overcome these
issues, but I still get the following error:

OPTIQAP.PAS(18,21) Error: Identifier not found "HeapError"
OPTIQAP.PAS(19,6) Error: Identifier not found "HeapError"

As I mentioned in the previous e-mail, this code was provided by me by a
reputed professor, so I have reasons to believe it's correct. My question
is: do you know if this error could be happening due to some version
incompatibility or some missing flag during compilation? Or is it probably
caused by some mistake in the code? Or would you need more information to
answer this?

Sorry if the question is silly, as I've mentioned, this is my first contact
with Pascal and FPC.

Thanks in advance for any help,
-- 
--  Luiz G. de Oliveira Neto --
 Unicamp - EC09 ---
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-15 Thread Sven Barth
Am 15.10.2016 17:39 schrieb "Snorkl e" :
>
> Sven,
> Just a fyi, the mantis bug report form would not let me pick a Severity
so its showing up as minor.

Thank you for reporting the bug.
Yes, we've disabled the severity, cause the severity we assume is not
usually the severity of the user.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-15 Thread Snorkl e
Sven,
Just a fyi, the mantis bug report form would not let me pick a Severity

so its showing up as minor.

On Sat, Oct 15, 2016 at 10:36 AM, Snorkl e  wrote:

> Sven,
> Bug report added:  http://bugs.freepascal.org/view.php?id=30747
>
> Have a great weekend :-)
>
> On Sat, Oct 15, 2016 at 3:30 AM, Sven Barth 
> wrote:
>
>> Am 15.10.2016 09:52 schrieb "Snorkl e" :
>> >
>> > Sven,
>> > Your idea worked.  I downloaded the FPC source and made that change and
>> then built everything to another directory.
>> > modified the fpc.cfg to not point to the FPC dir in the Lazarus folder
>> and made the path changes in the Lazarus IDE.
>> > Compiled the project with the fresh build and did the same stress test
>> and no issues with error 161.
>>
>> Thank you for confirming.
>>
>> > Should I do bug report in the FPC bug tracker?  Do you think the fix
>> will be able to be included in the next FPC release?
>> >
>>
>> Please file a bug report so that it's not forgotten. Considering that
>> it's a serious bug regarding events (and maybe others that have names, I'll
>> have to check that) I hope that I'll get approval to have it merged to
>> 3.0.x.
>>
>> Regards,
>> Sven
>>
>> ___
>> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>>
>
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-15 Thread Snorkl e
Sven,
Bug report added:  http://bugs.freepascal.org/view.php?id=30747

Have a great weekend :-)

On Sat, Oct 15, 2016 at 3:30 AM, Sven Barth 
wrote:

> Am 15.10.2016 09:52 schrieb "Snorkl e" :
> >
> > Sven,
> > Your idea worked.  I downloaded the FPC source and made that change and
> then built everything to another directory.
> > modified the fpc.cfg to not point to the FPC dir in the Lazarus folder
> and made the path changes in the Lazarus IDE.
> > Compiled the project with the fresh build and did the same stress test
> and no issues with error 161.
>
> Thank you for confirming.
>
> > Should I do bug report in the FPC bug tracker?  Do you think the fix
> will be able to be included in the next FPC release?
> >
>
> Please file a bug report so that it's not forgotten. Considering that it's
> a serious bug regarding events (and maybe others that have names, I'll have
> to check that) I hope that I'll get approval to have it merged to 3.0.x.
>
> Regards,
> Sven
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-15 Thread Sven Barth
Am 15.10.2016 09:52 schrieb "Snorkl e" :
>
> Sven,
> Your idea worked.  I downloaded the FPC source and made that change and
then built everything to another directory.
> modified the fpc.cfg to not point to the FPC dir in the Lazarus folder
and made the path changes in the Lazarus IDE.
> Compiled the project with the fresh build and did the same stress test
and no issues with error 161.

Thank you for confirming.

> Should I do bug report in the FPC bug tracker?  Do you think the fix will
be able to be included in the next FPC release?
>

Please file a bug report so that it's not forgotten. Considering that it's
a serious bug regarding events (and maybe others that have names, I'll have
to check that) I hope that I'll get approval to have it merged to 3.0.x.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] teventobject.create fails with error 161

2016-10-15 Thread Snorkl e
Sven,
Your idea worked.  I downloaded the FPC source and made that change and
then built everything to another directory.
modified the fpc.cfg to not point to the FPC dir in the Lazarus folder and
made the path changes in the Lazarus IDE.
Compiled the project with the fresh build and did the same stress test and
no issues with error 161.

Should I do bug report in the FPC bug tracker?  Do you think the fix will
be able to be included in the next FPC release?

Thanks again.


On Fri, Oct 14, 2016 at 3:41 PM, Sven Barth 
wrote:

> Am 14.10.2016 20:31 schrieb "Snorkl e" :
> >
> > Yep, I used heaptr, my code is clean.
> > Sometimes it would happen after 3 connects/disconnects and sometimes
> after 500.
> > With the GUID as the event name it has never happened again and I really
> stress tested it.
> >
> > It sounds like windows bug to me, but who knows.
>
> Looking at the code of the RTL it could be a FPC bug. FPC calls
> CreateEvent() basically like this:
>
> Result := CreateEvent(..., PChar(Name));
>
> Now the point is that by Name being a String the result of PChar(Name) is
> always a valid string consisting only of #0. That however is not equal to
> Nil which the documentation on MSDN states as necessary for an anonymous
> event.
>
> Are you able to compile FPC and its RTL yourself? In that case I'd like to
> ask you to adjust the function BasicEventCreate in
> $fpcdir/rtl/win/systhrd.inc like this:
>
> var
>   n: PChar;
> begin
>   new(plocaleventrec(result));
>   if Length(Name) = 0 then
> n := Nil
>   else
> n := PChar(Name);
>   plocaleventrec(result)^.FHandle := CreateEvent(EventAttributes,
> AManualReset, InitialState, n);
> end;
>
> With this and rebuilt RTL, packages and Co I'd ask you to test your code
> again and report back whether that solves the problem.
>
> Regards,
> Sven
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal