From: Ed <ej...@id...> - 2006-12-01 19:43:37
|
Brian Dessent <br...@de...> writes: > You're trying to call a C function from C++, but your function has not > been declared 'extern "C"'. This has nothing to do with the fact that > it's MinGW and MSVC++, it's all due to C/C++ semantics. The example > assumes that both modules are C. Right you are Brian! Thanks, now the dll works as expected from Visual Studio. The DLL menace was at an end. The quest for the Holy Grail could continue... Here's what works for me: testdll.h: #ifdef __cplusplus extern "C" { #endif __declspec(dllimport) int call_me(int i); #ifdef __cplusplus } #endif testdll.c: __declspec(dllexport) int call_me(int i) { return i-5; } Thanks Brian! Ed |