LNK2019与LNK1120 20
菜鸟一个。代码如下:#include<stdio.h>#include<stdlib.h>read(char*p1,char*p2){FILE*fptr;unsigned...
菜鸟一个。代码如下:
#include<stdio.h>
#include<stdlib.h>
read( char *p1, char *p2)
{
FILE *fptr;
unsigned short buf[512][512];
unsigned short image[512][512];
unsigned short* ptr=&image[0][0];
#define timechar_size 20
#define offset -512*512*2
#define count 512*512
if((fptr=fopen(p1,"rb"))==NULL)
{
printf("cannot open the file!");
exit(1);
}
fseek(fptr,offset,SEEK_END);
fread(buf,sizeof(unsigned short),count,fptr);
for (int i=0;i++;i< 512);
{
for(int j=0;j++;j< 512)
image[i][j]=buf[j][i];
}
int cn=0;
unsigned short *pt;
pt=(unsigned short*)(p2);
do{
*(pt++)=*(ptr++);
cn+=1;
}
while(cn<512*512);
return 0;
}
编译没有问题,但在链接时出现了两个错误:
imread error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
imread fatal error LNK1120: 1 unresolved externals
始终搞不定,那位达人帮帮忙啊,万分感谢!!!!目前我分数不够多,还请见谅啊!
我想问楼上的,“外部符号_main参照功能_maincrtstartup ”如何参照,本人菜鸟,还不会调试啊! 展开
#include<stdio.h>
#include<stdlib.h>
read( char *p1, char *p2)
{
FILE *fptr;
unsigned short buf[512][512];
unsigned short image[512][512];
unsigned short* ptr=&image[0][0];
#define timechar_size 20
#define offset -512*512*2
#define count 512*512
if((fptr=fopen(p1,"rb"))==NULL)
{
printf("cannot open the file!");
exit(1);
}
fseek(fptr,offset,SEEK_END);
fread(buf,sizeof(unsigned short),count,fptr);
for (int i=0;i++;i< 512);
{
for(int j=0;j++;j< 512)
image[i][j]=buf[j][i];
}
int cn=0;
unsigned short *pt;
pt=(unsigned short*)(p2);
do{
*(pt++)=*(ptr++);
cn+=1;
}
while(cn<512*512);
return 0;
}
编译没有问题,但在链接时出现了两个错误:
imread error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
imread fatal error LNK1120: 1 unresolved externals
始终搞不定,那位达人帮帮忙啊,万分感谢!!!!目前我分数不够多,还请见谅啊!
我想问楼上的,“外部符号_main参照功能_maincrtstartup ”如何参照,本人菜鸟,还不会调试啊! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询