469,299 Members | 2,093 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

unicode and linking problems

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?

Oct 31 '05 #1
2 1884
On 31 Oct 2005 15:06:55 -0800, "bobnotbob" <bo*******@comcast.net>
wrote in comp.lang.c++:
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
news:comp.os.ms-windows.programmer.win32 for this sort of platform
specific issue.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 1 '05 #2
Thank you and sorry for the inadvertant spam.

Nov 1 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Bill Eldridge | last post: by
30 posts views Thread by aurora | last post: by
2 posts views Thread by Neil Schemenauer | last post: by
2 posts views Thread by bobnotbob | last post: by
19 posts views Thread by Thomas W | last post: by
5 posts views Thread by =?Utf-8?B?S2V2aW4gVGFuZw==?= | last post: by
9 posts views Thread by Gerry | last post: by
1 post views Thread by Mudcat | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.