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. Web Development
  3. ASP.NET
  4. strange c++ compiler error

strange c++ compiler error

Scheduled Pinned Locked Moved ASP.NET
helpcsharpc++visual-studioquestion
2 Posts 1 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.
  • I Offline
    I Offline
    IlanTal
    wrote on last edited by
    #1

    I don't know if anyone will be able to help me, but I have a real strange error with c++ on Visual Studio on my XP. I have a code fragment: if( !Directory::Exists(out1)) Directory::CreateDirectory(out1); Exists compiles with no problem but CreateDirectory gives me the following error: error C2039 'CreateDirectoryA' is not a member of 'System::IO:Directory' When I put the cursor on CreateDirectory, it correctly identifies it as System::IO:CreateDirectory(System::String __gc*). Then when I compile Exists goes through OK, but CreateDirectory turns into the ANSI version of CreateDirectory which it then claims isn't part of the class (as it probably isn't). Who asked the compiler to turn CreateDirectory into CreateDirectoryA? If anyone has any suggestions, I'd be very grateful. Thanks, Ilan

    I 1 Reply Last reply
    0
    • I IlanTal

      I don't know if anyone will be able to help me, but I have a real strange error with c++ on Visual Studio on my XP. I have a code fragment: if( !Directory::Exists(out1)) Directory::CreateDirectory(out1); Exists compiles with no problem but CreateDirectory gives me the following error: error C2039 'CreateDirectoryA' is not a member of 'System::IO:Directory' When I put the cursor on CreateDirectory, it correctly identifies it as System::IO:CreateDirectory(System::String __gc*). Then when I compile Exists goes through OK, but CreateDirectory turns into the ANSI version of CreateDirectory which it then claims isn't part of the class (as it probably isn't). Who asked the compiler to turn CreateDirectory into CreateDirectoryA? If anyone has any suggestions, I'd be very grateful. Thanks, Ilan

      I Offline
      I Offline
      IlanTal
      wrote on last edited by
      #2

      I found the problem in WinBase.h. It has #ifdef UNICODE #define CreateDirectory CreateDirectoryW #else #define CreateDirectory CreateDirectoryA #endif // !UNICODE I added #undef CreateDirectory and it now compiles.

      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