这是啥子情况昂 怎么改完了就不行了 求助下大佬们
运行一下下面显示这个错误 ld returned 1 exit status 源码发上来啊 心驰神往 发表于 2021-1-22 13:17源码发上来啊
printf("计算中...\n");
改完这个就不行了
#include<io.h>
#include<direct.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 256
long total;
int countLines(const char *filename);
void findAllCodes(const char *path);
void findALLFiles(const char *path);
int countLines(const char *filename)
{
FILE *fp;
int count=0;
int temp;
if((fp=fopen(filename,"r"))==NULL)
{
fprintf(stderr,"Can not open the file:%s\n",filename);
return 0;
}
while((temp=fgetc(fp))!=EOF)
{
if(temp=='\n')
{
count++;
}
}
fclose(fp);
return count;
}
void findALLCodes(const char *path)
{
struct _finddata_t fa;
long handle;
char thePath,target;
strcpy(thePath,path);
if((handle = _findfirst(strcat(thePath,"/+.c"),&fa))!= -1L)
{
do
{
sprintf(target,"%s%s",path,fa.name);
total += countLines(target);
}while (_findnext(handle,&fa)==0);
}
_findclose(handle);
}
void findALLDirs(const char *path)
{
struct _finddata_t fa;
long handle;
char thePath;
strcpy(thePath,path);
if((handle = _findfirst(strcat(thePath,"/"),&fa))== -1L)
{
fprintf(stderr,"The path %s is wrong!\n",path);
return;
}
do
{
if(!strcmp(fa.name,".") || strcmp(fa.name,".."))
continue;
if(fa.attrib == _A_SUBDIR)
{
sprintf(thePath,"%s%s", path, fa.name);
findAllCodes(thePath);
findALLDirs(thePath);
}
}while (_findnext(handle,&fa) == 0);
_findclose(handle);
}
int main()
{
char path=".";
printf("计算中...\n"); 你是不是已经运行了一遍程序,弹出的窗口没有关?
关掉试试 这是连接器报错,应该是编译输出最终可执行文件的时候出现了问题,你要编译生成的这个可执行文件是不是正在运行?如果是这样,那就不得行,你得先把程序终止掉,然后再编译。 jackz007 发表于 2021-1-22 13:26
这是连接器报错,应该是编译输出最终可执行文件的时候出现了问题,你要编译生成的这个可执行文件是 ...
咋看是不是正在运行 我把软件关了重新开了 还是一样埃{:5_100:} qiuyouzhi 发表于 2021-1-22 13:20
你是不是已经运行了一遍程序,弹出的窗口没有关?
关掉试试
应该没有 前面一直在修改错误得地方 到这边改完就不行了{:5_100:}
页:
[1]