dll与exe之间的问题
Linking...
BBB.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) int __cdecl Add(int,int)" (__imp_?Add@@YAHHH@Z)
Debug/BBB.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
.exe:
==================================
#include "stdafx.h"
#include "..\AAA\AAA.h"
int main(int argc, char* argv[])
{
int a;
a=Add(10,10);
printf("Hello World!\n");
printf("%d",a);
return 0;
}
.dll:
==================================
.h:
*************
#ifdef AAA_EXPORTS
#define AAA_API __declspec(dllexport)
#else
#define AAA_API __declspec(dllimport)
#endif
AAA_API int Add( int a, int b );
AAA_API void Function( void );
.cpp
*************
#include "stdafx.h"
#include <iostream.h>
#include "AAA.h"
int Add( int a, int b )
{
return( a + b );
}
// Function will print out a text string
void Function( void )
{
cout<< "DLL Called!" <<endl;
}
谁来解决这个问题?
(不要说的太笼统,详细一些,最好把运行成功的开发包[不要删任何文件]发我邮箱[skyair624@yahoo.com.cn]!在此先谢谢了!如能解决马上结帖赠分。)