IntelliSense: declaration is incompatible with

This is a discussion on IntelliSense: declaration is incompatible with within the C Programming forums, part of the General Programming Boards category; Hi all I have this in a .C file, the last line of this declaration is line 19: Code: EXTERN ...

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    14

    IntelliSense: declaration is incompatible with

    Hi all

    I have this in a .C file, the last line of this declaration is line 19:

    Code:
    EXTERN struct 
    	{
    	int len;
    	int pitch;
    	int size;
    	} PrTbl[6];
    which seems to be perfectly correct, except that the VC++ 2010 give me this error message that does not make any sense to me. It looks like a circular error that the declaration is incompatible with itself:

    IntelliSense: declaration is incompatible with "struct <unnamed> PrTbl[6]" (declared at line 19)

    I tried to give a name to the struct, but the message was the same.
    Any idea please.Thanks
    ZA

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,848
    Consider this example, separating the struct declaration from the array declaration.
    Code:
    struct foo
    	{
    	int len;
    	int pitch;
    	int size;
    	};
    EXTERN struct foo PrTbl[6];
    One of the problems with combining it all in one (especially when it is an anonymous struct) is actually declaring the instance.
    Code:
    extern struct { int member; } array[10];
    struct { int member; } array[10];
    are two distinct (anonymous) structs, even though both contain the same members.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    14

    Separation of declarations

    It did the trick...
    Thanks
    ZA

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 11:17 AM
  2. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21