【c++】 Cannot open include file: ✀afx.h✀: No such file or directory

#include <afx.h>#include "NLPIR.h"#include <iostream>using namespace;void ParserDirectory(char* strDirName);int main(int argc,char* argv[]){/* if(!NLPIR_Init()) { printf("Init fails尀n"); return -1; } printf("Input sentence now(✀q✀ to quit)!尀n"); ParserDirectory(argv[1]);*/ ParserDirectory(char* strDirName); return 0;}void ParserDirectory(char* strDirName){ CFileFind tempFind; char strTempFileFind[MAX_PATH]; sprintf(strTempFileFind,"%s尀尀*.txt*", strDirName); BOOL IsFinded = tempFind.FindFile(strTempFileFind); while (IsFinded) { IsFinded = tempFind.FindNextFile(); if (!tempFind.IsDots()) { char strFoundFileName[MAX_PATH]; strcpy(strFoundFileName, tempFind.GetFileName().GetBuffer(MAX_PATH));if (tempFind.IsDirectory()) { char strTempDir[MAX_PATH]; sprintf(strTempDir,"%s尀尀%s", strDirName, strFoundFileName); ParserDirectory(strTempDir); } else { //NLPIR_FileProcess(strFoundFileName,strFoundFileName,1);//找到一个文件,strFoundFileName为文件名 //在此添加处理 } } } tempFind.Close();}
2026年09月25日 11:55
有1个网友回答
网友(1):

要使用

需要在VS里面配置一个 “使用共享的MFC”
如果是创建工程时没有选择使用MFC,默认选择项是只使用windows api。