Unresolved External Symbol - Visual Studio 2017

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Aethersong
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Aug 30, 2017 3:27 pm

Unresolved External Symbol - Visual Studio 2017

Post by Aethersong »

I found a program on Github that uses wxWidgets and I am having difficulties getting it to run on my computer.
This is the program I am trying to compile:
https://github.com/mfosse/JoyCon-Driver

I went to the wxWidgets github and downloaded the wxWidgets exe ( wxMSW-3.0.3-Setup.exe ) and the Microsoft Visual C++ 14.1 binaries ( wxMSW-3.0.3_vc141_Dev.7z ).
https://github.com/wxWidgets/wxWidgets/ ... tag/v3.0.3

When I try to compile the program, I am getting Unresolved External Symbol errors, so I am guessing I have a library error somewhere, but I am not sure what I should do.

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2001	unresolved external symbol "char const * const wxPanelNameStr" (?wxPanelNameStr@@3QBDB)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "void (__cdecl* wxTheAssertHandler)(class wxString const &,int,class wxString const &,class wxString const &,class wxString const &)" (?wxTheAssertHandler@@3P6AXABVwxString@@H000@ZA)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "char const * const wxStaticTextNameStr" (?wxStaticTextNameStr@@3QBDB)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "class wxEventTypeTag<class wxCommandEvent> const wxEVT_CHECKBOX" (?wxEVT_CHECKBOX@@3V?$wxEventTypeTag@VwxCommandEvent@@@@B)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "protected: static class wxAppConsole * (__cdecl* wxAppConsoleBase::ms_appInitFn)(void)" (?ms_appInitFn@wxAppConsoleBase@@1P6APAVwxAppConsole@@XZA)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "char const * const wxFrameNameStr" (?wxFrameNameStr@@3QBDB)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "protected: static class wxAppConsole * wxAppConsoleBase::ms_appInstance" (?ms_appInstance@wxAppConsoleBase@@1PAVwxAppConsole@@A)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "class wxMBConv * wxConvLibcPtr" (?wxConvLibcPtr@@3PAVwxMBConv@@A)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "char const * const wxButtonNameStr" (?wxButtonNameStr@@3QBDB)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "class wxEventTypeTag<class wxFocusEvent> const wxEVT_SET_FOCUS" (?wxEVT_SET_FOCUS@@3V?$wxEventTypeTag@VwxFocusEvent@@@@B)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "class wxEventTypeTag<class wxNavigationKeyEvent> const wxEVT_NAVIGATION_KEY" (?wxEVT_NAVIGATION_KEY@@3V?$wxEventTypeTag@VwxNavigationKeyEvent@@@@B)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "public: static unsigned int const wxString::npos" (?npos@wxString@@2IB)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "class wxSize const wxDefaultSize" (?wxDefaultSize@@3VwxSize@@B)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "bool wxTrapInAssert" (?wxTrapInAssert@@3_NA)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "wchar_t const * const wxEmptyString" (?wxEmptyString@@3PB_WB)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "char const * const wxCheckBoxNameStr" (?wxCheckBoxNameStr@@3QBDB)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "class wxEventTypeTag<class wxCommandEvent> const wxEVT_BUTTON" (?wxEVT_BUTTON@@3V?$wxEventTypeTag@VwxCommandEvent@@@@B)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "class wxEventTypeTag<class wxChildFocusEvent> const wxEVT_CHILD_FOCUS" (?wxEVT_CHILD_FOCUS@@3V?$wxEventTypeTag@VwxChildFocusEvent@@@@B)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "class wxValidator const wxDefaultValidator" (?wxDefaultValidator@@3VwxValidator@@B)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK2001	unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition@@3VwxPoint@@B)	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\main.obj	1	
Error	LNK1120	20 unresolved externals	joycon-driver	C:\Users\User\Documents\MiraiSouzou\JoyCon-Driver-master\joycon-driver\build\Win32\Release\joycon-driver.exe	1	
Character Set: Unicode
Runtime Library: Multi-threaded DLL (/MD)

Include Directories:

Code: Select all

$(SolutionDir)\$(ProjectName)\full\wxWidgets-3.0.3\lib\vc_lib\mswu
$(SolutionDir)\$(ProjectName)\full\wxWidgets-3.0.3\include
Library Directories:

Code: Select all

$(SolutionDir)\$(ProjectName)\full\wxWidgets-3.0.3\lib\vc_lib
Additional Dependecies:

Code: Select all

hidapi.lib
vJoyInterface.lib
wxmsw30u_core.lib
wxbase30u.lib
wxtiff.lib
wxjpeg.lib
wxpng.lib
wxzlib.lib
wxregexu.lib
wxexpat.lib
kernel32.lib
user32.lib
gdi32.lib
comdlg32.lib
winspool.lib
winmm.lib
shell32.lib
shlwapi.lib
comctl32.lib
ole32.lib
oleaut32.lib
uuid.lib
rpcrt4.lib
advapi32.lib
version.lib
wsock32.lib
wininet.lib
How can I fix the symbol errors?

Sorry if I am making some simple mistakes.
I am new to this library.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Unresolved External Symbol - Visual Studio 2017

Post by doublemax »

I found a program on Github that uses wxWidgets and I am having difficulties getting it to run on my computer.
Do you just want to use it or do you want to build and modify it? If you only want to use it, there seem to be compiled binaries in the repository:
https://github.com/mfosse/JoyCon-Driver ... 32/Release
I went to the wxWidgets github and downloaded the wxWidgets exe
Apparently the repository also includes the complete wxWidgets source including object files and binaries, so you probably wouldn't have to download it yourself. Make sure your copy doesn't conflict with the embedded version. I don't know if this was an accident, or if the developer did it on purpose because he modified the wxWidgets sources.

I can't explain all errors, but two things caught my eye:

Code: Select all

char const *
This indicates that the project is not in Unicode mode and it looks for ANSI functions.

Code: Select all

bool wxTrapInAssert
This should only be visible in debug mode.

There are at least two configuration mismatches. Try to fix those and check how many errors are left afterwards.
Use the source, Luke!
Aethersong
In need of some credit
In need of some credit
Posts: 2
Joined: Wed Aug 30, 2017 3:27 pm

Re: Unresolved External Symbol - Visual Studio 2017

Post by Aethersong »

doublemax wrote:Do you just want to use it or do you want to build and modify it? If you only want to use it, there seem to be compiled binaries in the repository:
I am looking to modify it for a school project.
doublemax wrote: I can't explain all errors, but two things caught my eye:

Code: Select all

char const *
This indicates that the project is not in Unicode mode and it looks for ANSI functions.

Code: Select all

bool wxTrapInAssert
This should only be visible in debug mode.

There are at least two configuration mismatches. Try to fix those and check how many errors are left afterwards.
When I initially tried to compile the project, it was missing the needed wxWidgets libraries. In the project settings it was looking for the above libraries such as

Code: Select all

wxmsw30u_core.lib
wxbase30u.lib
which are for unicode projects, right?
I added the needed libraries by downloading the binaries online, but got the above errors.

When I started the project it is set to a unicode character set, and there is a setup header in the include folder which has the lines

Code: Select all

#ifndef wxUSE_UNICODE
    #define wxUSE_UNICODE 1
#endif 
I guess I am kind of stumped at what to do :?
Post Reply