By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,435 Members | 1,485 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,435 IT Pros & Developers. It's quick & easy.

unicode and linking problems

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
Thank you and sorry for the inadvertant spam.

Nov 1 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.