NO

Author Topic: Error with RECT structure  (Read 963 times)

Offline iwrbc

  • Member
  • *
  • Posts: 16
Error with RECT structure
« on: June 23, 2022, 05:40:41 PM »
Hi, I encounter a strange problem. It is about this code:
Code: [Select]
  RECT rc;
  rc.left = 1;
  rc.top = 1;
I chose the member 'top' from the dropdown of suggestions, yet the third line gives me the errors:
error #2047: Expected a member name.
error #2001: Syntax error: expected ';' but found 'integer constant'.
error #2088: Lvalue required.

Yet 'top' is a member of RECT, and elsewhere in the program exactly the same line compiles fines...
Any suggestions?

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Error with RECT structure
« Reply #1 on: June 23, 2022, 06:10:58 PM »
Hello iwrbc,
I can't reproduce your error here.
Please provide a minimal verifiable sample.
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline iwrbc

  • Member
  • *
  • Posts: 16
Re: Error with RECT structure
« Reply #2 on: June 23, 2022, 06:16:29 PM »
Yes, I expected that question, but it is in a program of almost 20000 lines... I will see what I can do, thanks anyway.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Error with RECT structure
« Reply #3 on: June 23, 2022, 07:09:57 PM »
Yes, I expected that question, but it is in a program of almost 20000 lines... I will see what I can do, thanks anyway.
I understand, but the cause should be elsewhere, probably a redefinition somewhere.
With this exercise hopefully you'll find the problem by yourself  8)
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Offline John Z

  • Member
  • *
  • Posts: 790
Re: Error with RECT structure
« Reply #4 on: June 24, 2022, 01:50:56 PM »
Hi iwrbc,

Clearly the syntax is correct.  So the issue is elsewhere.
For example it would help to know the line numbers given in the compile error report, and the source line number of the RECT rc; line?
Do you use multiple source files?  Is 'rc' a global or local variable.
You can search for rc and see is inadvertently redefined somewhere like INT rc;
Turn on Level 2 warnings might provide some more information.

John Z