NO

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

Offline iwrbc

  • Member
  • *
  • Posts: 14
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: 1923
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.

Offline iwrbc

  • Member
  • *
  • Posts: 14
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: 1923
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)

Offline John Z

  • Member
  • *
  • Posts: 440
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