Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can't debug if including 'vector'

Can't debug if including 'vector'

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpcsharpvisual-studiographics
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ScorpioMidget
    wrote on last edited by
    #1

    If i try to compile my mfc dialog application in DEBUG configuration with a '#include inside one of my cpp files or headers, i get the following error messages: c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op erator new(void))(unsigned int)' c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(16) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' : could not deduce template argument for 'void *(__cdecl *)(u nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl *)(unsigned int)' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' and 'void *(__cdecl *__cdecl operator new(void))(unsigned int )' have different return types c:\program files\microsoft visual studio\vc98\include\memory(16) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\memory(20) : error C2954: template definitions cannot nest Error executing cl.exe. Creating browse info file... I can't figure out why this happens or how to fix it. BTW it compiles without the #include in DEBUG configuration. And it also compiles with/without it in RELEASE configuration. I'm using VC++ 6

    R S A 3 Replies Last reply
    0
    • S ScorpioMidget

      If i try to compile my mfc dialog application in DEBUG configuration with a '#include inside one of my cpp files or headers, i get the following error messages: c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op erator new(void))(unsigned int)' c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(16) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' : could not deduce template argument for 'void *(__cdecl *)(u nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl *)(unsigned int)' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' and 'void *(__cdecl *__cdecl operator new(void))(unsigned int )' have different return types c:\program files\microsoft visual studio\vc98\include\memory(16) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\memory(20) : error C2954: template definitions cannot nest Error executing cl.exe. Creating browse info file... I can't figure out why this happens or how to fix it. BTW it compiles without the #include in DEBUG configuration. And it also compiles with/without it in RELEASE configuration. I'm using VC++ 6

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      Put your include<vector> AFTER #include <stdafx.h> [edit] I meant BEFORE. Does this happen to you sometimes ? I was thinking "BEFORE, not AFTER" and finally wrote AFTER :rolleyes: [/edit] ~RaGE();

      1 Reply Last reply
      0
      • S ScorpioMidget

        If i try to compile my mfc dialog application in DEBUG configuration with a '#include inside one of my cpp files or headers, i get the following error messages: c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op erator new(void))(unsigned int)' c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(16) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' : could not deduce template argument for 'void *(__cdecl *)(u nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl *)(unsigned int)' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' and 'void *(__cdecl *__cdecl operator new(void))(unsigned int )' have different return types c:\program files\microsoft visual studio\vc98\include\memory(16) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\memory(20) : error C2954: template definitions cannot nest Error executing cl.exe. Creating browse info file... I can't figure out why this happens or how to fix it. BTW it compiles without the #include in DEBUG configuration. And it also compiles with/without it in RELEASE configuration. I'm using VC++ 6

        S Offline
        S Offline
        ScorpioMidget
        wrote on last edited by
        #3

        At last i got it 2 compile by putting #include above all mfc includes. Is the right way to go when mixing STL with MFC ? ScorpioMidget

        1 Reply Last reply
        0
        • S ScorpioMidget

          If i try to compile my mfc dialog application in DEBUG configuration with a '#include inside one of my cpp files or headers, i get the following error messages: c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op erator new(void))(unsigned int)' c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(16) : error C2061: syntax error : identifier 'THIS_FILE' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2091: function returns function c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' : could not deduce template argument for 'void *(__cdecl *)(u nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl *)(unsigned int)' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257'> &)' and 'void *(__cdecl *__cdecl operator new(void))(unsigned int )' have different return types c:\program files\microsoft visual studio\vc98\include\memory(16) : see declaration of 'new' c:\program files\microsoft visual studio\vc98\include\memory(17) : error C2809: 'operator new' has no formal parameters c:\program files\microsoft visual studio\vc98\include\memory(20) : error C2954: template definitions cannot nest Error executing cl.exe. Creating browse info file... I can't figure out why this happens or how to fix it. BTW it compiles without the #include in DEBUG configuration. And it also compiles with/without it in RELEASE configuration. I'm using VC++ 6

          A Offline
          A Offline
          Andrew Walker
          wrote on last edited by
          #4

          Move the vector header include above the debugging macro 'hack' that VC6 uses

          #include <vector>
          #define new DEBUG_NEW
          #undef THIS_FILE
          static char THIS_FILE[] = __FILE__;
          #endif

          :)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups