unicode and linking problems

B

bobnotbob

I have created an application and am trying to call functions from a
previously existing dll. I can call some functions fine, but I get a
link error an when I try to call any function that takes either an
LPCTSTR or wchar_tas a parameter.

Here's two functions that cause me problems:
void CADAPICALL JuncFunc9(LPCTSTR aaa);
void CADAPICALL JuncFunc10( wchar_t * aaa);
(CADAPICALL is defined as __declspec(dllexport) or
__declspec(dllimport))

Here's the errors I get:
InspectionPlanner error LNK2019: unresolved external symbol
"__declspec(dllimport) void __cdecl JuncFunc10(wchar_t *)"
(__imp_?JuncFunc10@@YAXPA_W@Z)
InspectionPlanner error LNK2019: unresolved external symbol
"__declspec(dllimport) void __cdecl JuncFunc9(char const *)"
(__imp_?JuncFunc9@@YAXPBD@Z)


I thought that maybe the problem is that the dll uses unicode, so I
converted my application to a unicode app by defining _UNICODE and
UNICODE in the project and adding the entry point wWinMainCRTStartup,
but I still got almost the exact same errors, except that LPCTSTR was
converted to "const wchar_t *" instead of "const char *"

Does anybody have any ideas what else might be causing these linking
problems?
 
J

Jack Klein

I have created an application and am trying to call functions from a
previously existing dll. I can call some functions fine, but I get a
link error an when I try to call any function that takes either an
LPCTSTR or wchar_tas a parameter.

Here's two functions that cause me problems:
void CADAPICALL JuncFunc9(LPCTSTR aaa);
void CADAPICALL JuncFunc10( wchar_t * aaa);
(CADAPICALL is defined as __declspec(dllexport) or
__declspec(dllimport))

Here's the errors I get:
InspectionPlanner error LNK2019: unresolved external symbol
"__declspec(dllimport) void __cdecl JuncFunc10(wchar_t *)"
(__imp_?JuncFunc10@@YAXPA_W@Z)
InspectionPlanner error LNK2019: unresolved external symbol
"__declspec(dllimport) void __cdecl JuncFunc9(char const *)"
(__imp_?JuncFunc9@@YAXPBD@Z)


I thought that maybe the problem is that the dll uses unicode, so I
converted my application to a unicode app by defining _UNICODE and
UNICODE in the project and adding the entry point wWinMainCRTStartup,
but I still got almost the exact same errors, except that LPCTSTR was
converted to "const wchar_t *" instead of "const char *"

Does anybody have any ideas what else might be causing these linking
problems?

Linkers, DLLs, and Unicode for that matter, are not part of the C++
language and are off-topic here. I'd suggest
for this sort of platform
specific issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top