Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » BEGIN_MESSAGE_MAP - not recognized(problem with indexer / syntax parser)
BEGIN_MESSAGE_MAP - not recognized [message #653312] Wed, 09 February 2011 10:28 Go to next message
Wolfgang  is currently offline Wolfgang Friend
Messages: 4
Registered: February 2011
Junior Member
a block like

BEGIN_MESSAGE_MAP(Proc1, Proc2)
END_MESSAGE_MAP()


is indicated with "syntax error" and the immediate following method is neither shown in the outline-view nor found in a search based on the indexer.

How could I tell CDT to ignore such blocks or to accept the syntax (which is correct for MS Visual Studio 2005)?

regards Wolfgang

[Updated on: Wed, 09 February 2011 10:29]

Report message to a moderator

Re: BEGIN_MESSAGE_MAP - not recognized [message #653408 is a reply to message #653312] Wed, 09 February 2011 16:32 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Wed, 09 Feb 2011 05:28:04 -0500, Wolfgang
<wolfgang.schaeuble@ubs.com> wrote:

>a block like
>
>BEGIN_MESSAGE_MAP(Proc1, Proc2)
>END_MESSAGE_MAP()
>
>is indicated with "syntax error" and the immediate following method is neither shown in the outline-view nor found in a search based on the indexer.
>
>How could I tell CDT to ignore such blocks or to accept the syntax (which is correct for MS Visual Studio 2005)?
>
>regards Wolfgang

BEGIN/END_MESSAGE_MAP are macros. You can go in to your C++ settings
in the "Paths and Symbols" section and define them as empty macros.
Re: BEGIN_MESSAGE_MAP - not recognized [message #654101 is a reply to message #653408] Mon, 14 February 2011 08:27 Go to previous messageGo to next message
Wolfgang  is currently offline Wolfgang Friend
Messages: 4
Registered: February 2011
Junior Member
It's no compiler generated "warning" but an eclipse warning.

Therefore defining BEGIN / END_MESSAGE_MAP as empty macros in C++ settings in the "Paths and Symbols" section didn't change anything.

The BEGIN / END_MESSAGE_MAP block is still marked with a "Syntax error" warning (an orange "?" besides the line number) and much more important the immediate following method isn't recognized by the eclipse parser and can't be found by a C-Search.

[Updated on: Mon, 14 February 2011 08:30]

Report message to a moderator

Re: BEGIN_MESSAGE_MAP - not recognized [message #654427 is a reply to message #654101] Tue, 15 February 2011 16:55 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Mon, 14 Feb 2011 09:28:05 +0100, Wolfgang
<wolfgang.schaeuble@ubs.com> wrote:

>It's no compiler generated "warning" but an eclipse warning.
>
>Therefore defining BEGIN / END_MESSAGE_MAP as empty macros in C++ settings in the "Paths and Symbols" section didn't change anything.
>
>The BEGIN / END_MESSAGE_MAP block is still marked with a "Syntax error" warning (an orange "?" besides the line number) and much more important the imediate following method isn't recognized by the eclipse parser and can't be found by a C-Search.

The problem really is that BEGIN/END_MESSAGE_MAP, and its associated
DECLARE_MESSAGE_MAP are macros that expand to fairly 'interesting'
pieces of code, all of which are Microsoft specific (which can cause
issues in Eclipse because, unless the latest version (8.0 or so) is
better, isn't really supported in Eclipse.

FWIW - afxwin.h has code that defined BEGIN_MESSAGE_MAP,
END_MESSAGE_MAP and DECLARE_MESSAGE_MAP, perhaps adding the path to
afxwin.h in your Paths and Symbols section may help. On my system it's
in C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include.
You may have to declare some other bits and pieces too though,
Re: BEGIN_MESSAGE_MAP - not recognized [message #654556 is a reply to message #654427] Wed, 16 February 2011 10:09 Go to previous messageGo to next message
Loaden  is currently offline Loaden Friend
Messages: 14
Registered: September 2009
Junior Member
Try:
#ifdef __CDT_PARSER__
#define BEGIN_MESSAGE_MAP()
#define END_MESSAGE_MAP()
#endif
Re: BEGIN_MESSAGE_MAP - not recognized [message #654592 is a reply to message #654101] Wed, 16 February 2011 12:38 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Wolfgang wrote on Mon, 14 February 2011 09:27
It's no compiler generated "warning" but an eclipse warning.

Therefore defining BEGIN / END_MESSAGE_MAP as empty macros in C++ settings in the "Paths and Symbols" section didn't change anything.

The BEGIN / END_MESSAGE_MAP block is still marked with a "Syntax error" warning (an orange "?" besides the line number) and much more important the immediate following method isn't recognized by the eclipse parser and can't be found by a C-Search.


Are the macros actually resolved? i.e. can you right click on them and select "Explore Macro Expansion" and it will show the actual code? When you select one of the macros and hit F3 will it show the macro declaration? If not then the Eclipse indexer misses an include header or better said the include path.
You can see which includes are missing by choosing Project Properties->Indexer->Show unresolved includes.



Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: BEGIN_MESSAGE_MAP - not recognized (solved) [message #654602 is a reply to message #653312] Wed, 16 February 2011 13:18 Go to previous messageGo to next message
Wolfgang  is currently offline Wolfgang Friend
Messages: 4
Registered: February 2011
Junior Member
Thank you very much for your useful hints.

A long time ago I had put
c:\program files\microsoft visual studio 8\vc\atlmfc\include
(MS Visual Studio v. 8 )
under "Path and Symbols" - "Includes", but only for Language "Assembly" and even not in all configurations.

Thus afxwin.h (containing BEGIN_MESSAGE_MAP etc.) was not found (e.g. after F3 OpenDeclaration).

Now after I've added the include path above to all Languages (and maybe not necessary for all configurations) the parser recognized the immediate following method as expected.
So now I can search for all methods with C++-Search (really great, - it was the main issue I had!!!).
And yes the macros now are resolved (they were not before).

There is still an orange "?" (Syntax error) at the left besides "BEGIN_MESSAGE_MAP (...)" and "END_MESSAGE_MAP ()", but this is no isssue for me, because it has no implication other than the visible "?".
I could fix it by surrounding the code with
#ifndef __CDT_PARSER__
BEGIN_MESSAGE_MAP(...)
END_MESSAGE_MAP()
#endif


So in my view this topic is solved!

Again thanks and regards
Wolfgang

[Updated on: Wed, 16 February 2011 13:20]

Report message to a moderator

Re: BEGIN_MESSAGE_MAP - not recognized [message #654603 is a reply to message #654592] Wed, 16 February 2011 13:24 Go to previous message
Wolfgang  is currently offline Wolfgang Friend
Messages: 4
Registered: February 2011
Junior Member
Hi Axel,

I can't find
Project Properties->Indexer->Show unresolved includes
but it would be very useful.

Ok, I found it Smile :
it's in the context menu of the project under
Index -> Search for unresolved includes.

[Updated on: Wed, 16 February 2011 13:30]

Report message to a moderator

Previous Topic:what are eclipse's default command line options for the compiler (g++)?
Next Topic:Trying to Set-up the Eclipse CDT
Goto Forum:
  


Current Time: Fri Mar 29 14:28:38 GMT 2024

Powered by FUDForum. Page generated in 0.04444 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top