Thank you both for the hints. The first library is 3rd-party and I believe only
tested for an all-C environment. This also means none of the header files have
the
#ifdef __cplusplus
extern "C" {
#endif
headers and
#ifdef __cplusplus
}
#endif
footers. The second library (mine) uses a mixed bag of C and C++ but all of the
header files are encapsulated appropriately with the headers and footers above.
I changed the header file in the 3rd-party library containing the troubled
export definitions, added the '#ifdef __cpluplus ...' items above, and
recompiled both libs. This did the trick although not really knowing C++ I have
no idea why the success. I received Deepak's suggestion after I made the
changes but applying it retroactively I receive "error C2059: syntax error :
'string'" everywhere. As is probably typical the '__declspec(dllexport)' is
achieved via a #define like 'EXPORT_SOMETHING'. I modified 'EXPORT_SOMETHING'
to '#define extern "C" __declspec(dllexport)' and that gets an extensive
littering of the C2059 error.
Anyway, I'm happy it's working although it would be nice to root cause the
problem and solution. Any more help is, of course, appreciated.
Thanks. Jerry.
----- Original Message -----
From: deepak patil
To: [email protected]
Sent: Thursday, August 19, 2010 1:31 AM
Subject: Re: [c-prog] VC++ linker can't find an export symbol
try extern "C" __declspec(dllexport) instead of __declspec(dllexport)...
On Thu, Aug 19, 2010 at 4:28 AM, <[email protected]> wrote:
>
>
> Greetings. I have a VC++ 2010 Express solution with two projects written in
> C. The first compiles a .dll and the second compiles a .dll, but also links
> with the first's corresponding .lib. Every export in the first has
> '__declspec(dllexport)' in the function declaration and definition. My
> second library links fine against every function in the first except for all
> exported symbols in one particular file. Using dumpbin.exe I can see all
> expected function symbols in the .dll and yet the linker always fails. Any
> idea why one file may have this problem while the others do not? I commented
> out all calls to the unresolved symbols except one and here's the output:
>
> error LNK2019: unresolved external symbol "void __cdecl BGDB_Delete(struct
> _BDADDR_t *)" (?BGDB_Delete@@YAXPAU_BDADDR_t@@@Z) referenced in function
> ...
>
> Any help is appreciated. Thanks. Jerry.
>
> [Non-text portions of this message have been removed]
>
>
>
--
Cheers,
Deepak...
"Never doubt tht "A small Group of People can Chage d WorlD"...InDeeD It's d
only d thinG tht eveR HAS...CoreWorlD."
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]