报错如下
出错的三个函数是某个cpp文件中的。但是这个cpp文件定义了更多其他的函数,只报错了这三个。
VS没问题,VC出错,函数的声明和定义是对应的,还会是什么原因呢?
Linking...
ShortestTime.obj : error LNK2001: unresolved external symbol "double __cdecl RandSolution(struct currentstate,int * const,class myPlatform &)" (?RandSolution@@YANUcurrentstate@@QAHAAVmyPlatform@@@Z)
ShortestTime.obj : error LNK2001: unresolved external symbol "struct state __cdecl TransformState(struct currentstate,class myPlatform *)" (?TransformState@@YA?AUstate@@Ucurrentstate@@PAVmyPlatform@@@Z)
ShortestTime.obj : error LNK2001: unresolved external symbol "struct state __cdecl PreSolution(struct currentstate,int * const,int * const,int * const,double * const,class myPlatform &)" (?PreSolution@@YA?AUstate@@Ucurrentstate@@QAH11QANAAVmyPlatfor
m@@@Z)
Debug/assignment.exe : fatal error LNK1120: 3 unresolved externals
执行 link.exe 时出错.
Creating browse info file...assignment.exe - 1 error(s), 0 warning(s)
像是加载了某个动态库,而那个动态库的lib文件不正确导致。
可能是你使用了最新的动态库头文件,较旧的lib文件导致。
请问所谓vs没问题vc有问题,是指vs2008等软件没问题,用vc6加载时候就报错吗?如果是这样可能是那几个函数里里面有在vs里面可用但vc里面不能用的接口或者其他定义
RandSolution/TransformState/PreSolution这三个函数在cpp文件中有对应的定义吗?