CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2004
    Posts
    62

    Problem with "additional include directories" and C2065

    Hi,

    I have Visual Studio 6.0 (patch 5) and need to have the includes (in a subdirectory of the project) in the project path and I added a path via "additional include directories" and I get following error messages:

    c:\program files\microsoft sdk\include\guiddef.h(161) : error C2065: 'memcmp' : undeclared identifier
    c:\program files\microsoft sdk\include\propidl.h(1404) : error C2065: 'memset' : undeclared identifier

    How do I get rid of them ?

    If I put the paths in the studio settings it works fine (cannot use this because those settings must not be changed) but not otherwise. It also works if I put all standard paths from the visual studio (3 that give a **** long string) and put them before my additional directories into the "additional include directories" textbox and disable the default include directories but that is also completely unacceptable.

    Does anyone know a solution to this ?

    To just make it work the way its meant to be ?

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Problem with "additional include directories" and C2065

    To just make it work the way its meant to be ?
    As far as I know, using the "Addional include"-option is the way it was meant to be.

  3. #3
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Problem with "additional include directories" and C2065

    I can't remember what it fixed but there's SP6 available. Maybe that does something good.

    Very wierd error message by the way. Check those lines, it might give a clue to what's going on.

  4. #4
    Join Date
    Nov 2007
    Posts
    613

    Re: Problem with "additional include directories" and C2065

    I suspect you don't have the necessary include directives.
    Do you use #include "memory.h" or #include "string.h" ? These are the header files where memset and memcmp are declared.
    (The <> symbols should be used only if you want the compiler to look in the standard include directories.)

    You can also use something like this:
    #include "C:\\MyFolder\\memory.h";

  5. #5
    Join Date
    Apr 2004
    Posts
    62

    Re: Problem with "additional include directories" and C2065

    Thanks for your replies but none of them really helped.

    The problem is very easy to reproduce. Just make an new mfc project and add any relative path into the "additional include directories" and the project will fail with:

    c:\program files\microsoft visual studio\vc98\include\objidl.h(9901) : error C2065: 'memset' : undeclared identifier
    c:\program files\microsoft visual studio\vc98\include\objbase.h(435) : error C2065: 'memcmp' : undeclared identifier

    As you can see the error messages are somewhere in the visual c++ includes themself and outside of my code. I looked in it and found just uses of memset and memcmp and the like that fail.

    I somehow have to include the directories of the include files in the project because I have several versions of the same files for different projects and that is the only way I know how to. Can someone please help me with this ?
    Last edited by Zaph-0; December 23rd, 2007 at 08:56 AM.

  6. #6
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Problem with "additional include directories" and C2065

    I made a MFC dialog project, created a header located elsewhere and include that in mfc6testdlg.cpp (see attached projectg) and it built properly.

    I guess that your problems originate from your own files since compilation fails on for instance the inlined memset in objidl.h.

    Does any of your headers have names that clash with standard or MS headers? Do you include files in the correct order?
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured