DLL をデバッグしたい。この DLL は、いくつかの関数と void をエクスポートします。
これはヘッダーです:
#ifdef CODEC_EXPORTS
#define CODEC_API __declspec(dllexport)
#else
#define CODEC_API __declspec(dllimport)
#endif
extern "C" CODEC_API int __stdcall SpxInit(void);
extern "C" CODEC_API int __stdcall SpxEncode(unsigned char* inBuf, unsigned char* outBuf, unsigned int inlen);
extern "C" CODEC_API int __stdcall SpxEncodeNormal(void);
extern "C" CODEC_API int __stdcall SpxDecode(unsigned char* DinBuf, float* DoutBuf, unsigned int Dinlen);
extern "C" CODEC_API int __stdcall SpxFree(void);
#pragma comment(linker, "/export:SpxEncode=_SpxEncode@12")
#pragma comment(linker, "/export:SpxEncodeNormal=_SpxEncodeNormal@0")
#pragma comment(linker, "/export:SpxDecode=_SpxDecode@12")
#pragma comment(linker, "/export:SpxInit=_SpxInit@0")
#pragma comment(linker, "/export:SpxFree=_SpxFree@0")
ソリューションに新しいプロジェクトを追加し、次の cpp ファイルを追加するだけです。
#include "stdafx.h"
#include "codec.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
他のことを試す前に、単に新しいプロジェクトをコンパイルしたかったのですが、VC2010 が教えてくれました
"error LNK2001" Unresolved external symbol "_SpxDecode@12"
"error LNK2001" Unresolved external symbol "_SpxEncode@12"
等...
だから私は何かを逃したと思いますが、何がわかりません。