Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-11

TRTLCriticalSection

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Antonio Fortuny

Hi Folks.

On Linux x86_?64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 Could anyone tell me why the next line
* EnterCriticalSection(CS);*
with the following compiler error:
/home/sources/production/lib/usimplelogger.pas(180,27) Error: Call by var for arg no. 1 has to match exactly:/*Got "Pointer" expected "QWord" :-\ */
with somewhere before the declaration:
*var

   CS: TRTLCriticalSection;

*
whilst in threadh.inc the is:
procedure EnterCriticalsection(var cs : TRTLCriticalSection);

which is pointed to when Ctrl-Left Click on the source unit word: *EnterCriticalSection

*Withsame Lazarus/FPC into Win32 Vista no compiler error and runs OK* *
Antonio.*
*

---
Ce courrier ?lectronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active. http://www.avast.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131129/a1b0df2e/attachment.html>

Reply by email

Sven Barth
to Antonio Fortuny
Antonio Fortuny wrote 20 lines
Hi Folks. On Linux x86_?64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 Could anyone tell me why the next line * EnterCriticalSection(CS);* with the following compiler error: /home/sources/production/lib/usimplelogger.pas(180,27) Error: Call by var for arg no. 1 has to match exactly:/*Got "Pointer" expected "QWord" :-\ */ with somewhere before the declaration: *var CS: TRTLCriticalSection; * whilst in threadh.inc the is: procedure EnterCriticalsection(var cs : TRTLCriticalSection); which is pointed to when Ctrl-Left Click on the source unit word: *EnterCriticalSection *Withsame Lazarus/FPC into Win32 Vista no compiler error and runs OK

Can it be that some other unit redefines EnterCriticalSection or TRTLCriticalSection? Could you test a simple program where you use TRTLCriticalSection to ensure that nothing is wrong there?

Regards,
Sven

PS: Would you please use text e-mails instead of HTML e-mails? -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131129/8fd63ebb/attachment.html>

Reply by email

Michael Van Canneyt
to Antonio Fortuny: Hi Folks. On Linux x86_?64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 Could anyone tell me why…
Antonio Fortuny wrote 18 lines
Hi Folks. On Linux x86_?64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 Could anyone tell me why the next line ? EnterCriticalSection(CS); with the following compiler error: /home/sources/production/lib/usimplelogger.pas(180,27) Error: Call by var for arg no. 1 has to match exactly: Got "Pointer" expected "QWord"? :-\ with somewhere before the declaration: var ? CS: TRTLCriticalSection; whilst in threadh.inc the is: procedure EnterCriticalsection(var cs : TRTLCriticalSection); which is pointed to when Ctrl-Left Click on the source unit word: EnterCriticalSection With same Lazarus/FPC into Win32 Vista no compiler error and runs OK

What does TRTLCriticalSection point to ?
There are multiple definitions floating around, make sure you are taking the one from the system unit:

var
  ? CS: system.TRTLCriticalSection;

Michael.

Reply by email

Antonio Fortuny
to Michael Van Canneyt

Le 29/11/2013 12:32, Michael Van Canneyt a ?crit :

Show quoted text 31 lines
On Fri, 29 Nov 2013, Antonio Fortuny wrote: > Hi Folks. > > On Linux x86_?64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 > Could anyone tell me why the next line > EnterCriticalSection(CS); > with the following compiler error: > /home/sources/production/lib/usimplelogger.pas(180,27) Error: Call by > var for arg no. 1 has to match exactly: Got "Pointer" > expected "QWord" :-\ > with somewhere before the declaration: > var > CS: TRTLCriticalSection; > > whilst in threadh.inc the is: > procedure EnterCriticalsection(var cs : TRTLCriticalSection); > > which is pointed to when Ctrl-Left Click on the source unit word: > EnterCriticalSection > > With same Lazarus/FPC into Win32 Vista no compiler error and runs OK What does TRTLCriticalSection point to ? There are multiple definitions floating around, make sure you are taking the one from the system unit: var CS: system.TRTLCriticalSection;

This dit it. instering the system unit reference removel all compile errors. This gives the answer to the previous Sven answer. It looks so trival that I Should have thought to this on my own. :-[

Many thanks Michael

Show quoted text 10 lines
Michael. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

---
Ce courrier ?lectronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active. http://www.avast.com

Reply by email

patspiper
to Michael Van Canneyt: What does TRTLCriticalSection point to ? There are multiple definitions floating around,…
Michael Van Canneyt wrote 31 lines
On Fri, 29 Nov 2013, Antonio Fortuny wrote: > Hi Folks. > > On Linux x86_?64 Opensuse, Lazarus 1.0.12, FPC 2.6.2 > Could anyone tell me why the next line > EnterCriticalSection(CS); > with the following compiler error: > /home/sources/production/lib/usimplelogger.pas(180,27) Error: Call by > var for arg no. 1 has to match exactly: Got "Pointer" > expected "QWord" :-\ > with somewhere before the declaration: > var > CS: TRTLCriticalSection; > > whilst in threadh.inc the is: > procedure EnterCriticalsection(var cs : TRTLCriticalSection); > > which is pointed to when Ctrl-Left Click on the source unit word: > EnterCriticalSection > > With same Lazarus/FPC into Win32 Vista no compiler error and runs OK What does TRTLCriticalSection point to ? There are multiple definitions floating around, make sure you are taking the one from the system unit: var CS: system.TRTLCriticalSection;

http://bugs.freepascal.org/view.php?id=25187 makes debugging this particular issue worse.

Stephano

Reply by email