c++ - Debugging a DLL that uses __stdcall and pragma linker -


i want debug dll. dll exports functions , voids:

this header:

#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") 

i added new project solution , added following cpp file:

#include "stdafx.h" #include "codec.h"  int _tmain(int argc, _tchar* argv[]) {     return 0; } 

now before trying else, wanted compile new project, vc2010 telling me

"error lnk2001" unresolved external symbol "_spxdecode@12" "error lnk2001" unresolved external symbol "_spxencode@12" 

etc...

so guess missed something, don't see what.

you need add reference dll project
project properties->common properties->references


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -