程序无法启动。。。系统找不到指定文件

#include"stdafx.h"
#include
#include
#include
using namespace cv;
using namespace std;

int main(){
CString abPath = "C:\Profram Files\feiq\Recv Files\ACSImage\cache\v3.2\代表图";
getFile(abPath);
}
void changeSize(CString cs_abPath,string abSavePath,CString fileName){
Mat img = imread(cs_abPath.GetBuffer);
Mat dst;
string savePath = abSavePath +"\" +fileName.GetBuffer+".jpg";
double scale;
int img_height = img.rows;
scale = 400.0/ img_height;
resize(img, dst, Size(0, 0), scale, scale);
imwrite(savePath,dst);
}
void getFile(CString pathStr){
CString myDataPath, fdPath;
myDataPath =pathStr+"\*.*";
CFileFind finder;
boolean buffer = finder.FindFile(myDataPath);
string abSavePath = "C:\Profram Files\feiq\Recv Files\ACSImage\cache\v3.2\代表图小图";
while (buffer)
{
buffer = finder.FindNextFileW();
if (!finder.IsDots){
/*fdPath是当前的路径,
判断:
如果当前这个路径下是文件夹 递归(fdPath)
如果当前这个路径下是文件 则调changeSize()
多个文件的可以吗??
保存文件的路径怎么办??
逻辑上还是有问题
*/
fdPath = finder.GetFilePath;
if (finder.IsDirectory)
{
getFile(fdPath);
}

else
{
changeSize(fdPath, abSavePath, finder.GetFileName());
}
}

}
finder.Close();
}

代码如上 win32AP 我想不用MFC然后调用MFC里的一些类, 出现题目所示问题.
1>------ Build started: Project: opencvTestBYljk, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(364,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
1> opencvTestBYljk.cpp
1>d:\lx\home\proj\cuda\opencvtestbyljk\opencvtestbyljk\opencvtestbyljk.cpp(10): error C3861: 'getFile': identifier not found
1>d:\lx\home\proj\cuda\opencvtestbyljk\opencvtestbyljk\opencvtestbyljk.cpp(13): error C3867: 'ATL::CSimpleStringT::GetBuffer': function call missing argument list; use '&ATL::CSimpleStringT::GetBuffer' to create a pointer to member
1>d:\lx\home\proj\cuda\opencvtestbyljk\opencvtestbyljk\opencvtestbyljk.cpp(15): error C2678: binary '+' : no operator found which takes a left-hand operand of type 'std::basic_string,std::allocator>' (or there is no acceptable conversion)
1> d:\opencv249\opencv\build\include\opencv2\core\mat.hpp(2001): could be 'cv::MatConstIterator cv::operator +(ptrdiff_t,const cv::MatConstIterator &)'
1> d:\opencv249\opencv\build\include\opencv2\core\mat.hpp(1998): or 'cv::MatConstIterator cv::operator +(const cv::MatConstIterator &,ptrdiff_t)'
1> d:\opencv249\opencv\build\include\opencv2\core\mat.hpp(1268): or 'cv::MatExpr cv::operator +(const cv::MatExpr &,const cv::MatExpr &)'
1> d:\opencv249\opencv\build\include\opencv2\core\mat.hpp(1267): or 'cv::MatExpr cv::operator +(const cv::Scalar &,const cv::MatExpr &)'
1> d:\opencv249\opencv\build\include\opencv2\core\mat.hpp(1266): or 'cv::MatExpr cv::operator +(const cv::MatExpr &,const cv::Scalar &)'
1> d:\opencv249\opencv\build\include\opencv2\core\mat.hpp(1265): or 'cv::MatExpr cv::operator +(const cv::Mat &,const cv::MatExpr &)'
1> d:\opencv249\opencv\build\include\opencv2\core\mat.hpp(1264): or 'cv::MatExpr cv::operator +(const cv::MatExpr &,const cv::Mat &)'
1> d:\opencv249\opencv\build\include\opencv2\core\mat.hpp(1263): or 'cv::MatExpr cv::operator +(const cv::Scalar &,const cv::Mat &)'
1> d:\opencv249\opencv\build\include\opencv2\core\mat.hpp(1262): or 'cv::MatExpr cv::operator +(const cv::Mat &,const cv::Scalar &)'
1> d:\opencv249\opencv\build\include\opencv2\core\mat.hpp(1261): or 'cv::MatExpr cv::operator +(const cv::Mat &,const cv::Mat &)'
1> d:\opencv249\opencv\build\include\opencv2\core\operations.hpp(2248): or 'cv::Range cv::operator +(int,const cv::Range &)'
1> d:\opencv249\opencv\build\include\opencv2\core\operations.hpp(2243): or 'cv::Range cv::operator +(const cv::Range &,int)'
1> while trying to match the argument list '(std::basic_string,std::allocator>, overloaded-function)'
1>d:\lx\home\proj\cuda\opencvtestbyljk\opencvtestbyljk\opencvtestbyljk.cpp(31): error C2276: '!' : illegal operation on bound member function expression
1>d:\lx\home\proj\cuda\opencvtestbyljk\opencvtestbyljk\opencvtestbyljk.cpp(40): error C3867: 'CFileFind::GetFilePath': function call missing argument list; use '&CFileFind::GetFilePath' to create a pointer to member
1>d:\lx\home\proj\cuda\opencvtestbyljk\opencvtestbyljk\opencvtestbyljk.cpp(40): error C2679: binary '=' : no operator found which takes a right-hand operand of type 'overloaded-function' (or there is no acceptable conversion)
1> d:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\cstringt.h(1322): could be 'ATL::CStringT>> &ATL::CStringT>>::operator =(const VARIANT &)'
1> d:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\cstringt.h(1314): or 'ATL::CStringT>> &ATL::CStringT>>::operator =(char)'
1> d:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\cstringt.h(1305): or 'ATL::CStringT>> &ATL::CStringT>>::operator =(wchar_t)'
1> d:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\cstringt.h(1299): or 'ATL::CStringT>> &ATL::CStringT>>::operator =(const unsigned char *)'
1> d:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\cstringt.h(1281): or 'ATL::CStringT>> &ATL::CStringT>>::operator =(const char *)'
1> d:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\cstringt.h(1273): or 'ATL::CStringT>> &ATL::CStringT>>::operator =(const wchar_t *)'
1> d:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\cstringt.h(1258): or 'ATL::CStringT>> &ATL::CStringT>>::operator =(const ATL::CStringT>> &)'
1> while trying to match the argument list '(CString, overloaded-function)'
1>d:\lx\home\proj\cuda\opencvtestbyljk\opencvtestbyljk\opencvtestbyljk.cpp(41): error C3867: 'CFileFind::IsDirectory': function call missing argument list; use '&CFileFind::IsDirectory' to create a pointer to member

3个回答

我经常遇到这样的问题,一直都迷糊$(OutDir)$(TargetName)$(TargetExt)、$(SolutionDir)$(Configuration)。闹不明白。
很多时候,我们会将一些低版本IDE编译过的项目,搬迁到VS2010 ,那么会存在很多编译,调试问题。
【1】 编译成功了。可是无法调试 。
.     &nb......
答案就在这里:vs2010 无法启动程序 系统找不到指定的文件
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?

检查下文件路径,以及你的权限。
fileName.GetBuffer
看上去是 fileName.GetBuffer()

CString是MFC中的类,要加相应的头文件

malxer
刘泥玛 我再网上查CString的头文件是#include<afx.h> 加了之后还是不可以
接近 4 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐