开发者

How to use Directory.GetFiles

I want to use Directory.GetFiles to read files from a folder. From msdn website i found: For c, i have include:

using System;
using System.IO;
开发者_JS百科

For C++, i have include:

#using <mscorlib.dll>
using namespace System;
using namespace System::IO;

as header.

For the C++, after the line #using is added, the "fatal error C1190: managed targeted code requires a '/clr' option" appears. So i tried by adding /clr in the visual studio Properties\Linker\Command Line as i found it in other website, but i fail too.

I did it wrongly. So, How to handle error of "fatal error C1190: managed targeted code requires a '/clr' option"? How to "compile with the /clr flag"?

Because i am writing for OpenCv, i have include the following additional dependencies in order to use c and c++:

cv210d.lib

cxcore210d.lib

highgui210d.lib

cvaux210d.lib

Cannot work. What other requirements in order to use Directory.GetFiles? I also cannot use foreach even i #include . Is there something similar to use foreach and Directory.GetFiles which is necessary to be included in a project?

I am using Visual Studio 2008

Please help me. Tq


You need to create managed c++ CLI, this should include all the flags for you. To set /clr from visual studio, go to porject properities->configurations properities->general set common language runtime support to /clr

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜