.net - trouble linking to de-decorated DLL names in C++ (32 bit) in Visual Studio -


i have library of dsp functions in c++ , want link them dynamically @ run time. using pdll.h method wrap classes (for example fft) c-style functions , load them load on fly in other c++ applications. want use these functions in .net applications , com components, have use __stdcall decorates names in 32 bit builds.

in order undecorate names, using trick mentioned here: c++ dll export: decorated/mangled names (wqw's answer, 2nd down). example, in library's .h file have declared wrapped functions so:

#pragma comment(linker, "/export:dofft=_dofft@12") rtlibs_api dofft(fft* x, double* pddatain, double* pddataout); 

this indeed work, , when dll dependency walker, see there both entry dofft , _dofft@12.

the problem have when try build project links library (dynamically, @ run time, not using .lib file @ all) linker errors functions in dll, i.e.:

error   31  error lnk2001: unresolved external symbol _dofft@12  

i don't understand why happening. first of all, symbol _dofft@12 exist (according dependency walker) , second of all, why linker looking in first place? linking @ run time, not @ compile time how project know symbol?

all functions declared same chain of macros reduces (e.g.):

extern "c" __declspec(dllexport) int __stdcall dofft(fft* x){...} 

nothing having library declared on client side.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -