Link to home
Start Free TrialLog in
Avatar of silentreproach
silentreproachFlag for United States of America

asked on

Compiler error with Directory::GetCurrentDirectory()

I am trying to use a std windows call,  String path= Directory::GetCurrentDirectory();   which is part of System.IO, but cannot assemble it because it cannot find #include <System>

What should be my #include statement to be able to use the getcurrentdirectory() function? The exact error is:

fatal error: Cannot open include file no such file or directory
Avatar of systan
Flag of Philippines image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of silentreproach


Either one gives the same message. do I have to include the Class System somewhere?
yes, pick it up
I gave up on #using System.dll which requires /Clr compile option, can't find it explained anywhere to compile it correctly with VS2008. This works okay instead:

char psCurDir[256];
LPSTR CurrentPath;
GetCurrentDirectory[256], psCurDir);
CurrentPath = psCurDir;