Linker erros in MVS 2008 Topic is solved

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.
comedinha
In need of some credit
In need of some credit
Posts: 9
Joined: Thu May 24, 2012 10:46 pm

Linker erros in MVS 2008

Post by comedinha »

Hello, i try compile a source in MVS 2008. I find errors:

Code: Select all

------ Build started: Project: Test, Configuration: Release Win32 ------
Compiling...
pngfiles.cpp
main.cpp
Linking...
main.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __thiscall wxAuiManagerEvent::GetClassInfo(void)const " (?GetClassInfo@wxAuiManagerEvent@@UBEPAVwxClassInfo@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __thiscall wxAuiNotebookEvent::GetClassInfo(void)const " (?GetClassInfo@wxAuiNotebookEvent@@UBEPAVwxClassInfo@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __thiscall wxSocketEvent::GetClassInfo(void)const " (?GetClassInfo@wxSocketEvent@@UBEPAVwxClassInfo@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(wchar_t const *,int,wchar_t const *,wchar_t const *,wchar_t const *)" (?OnAssertFailure@wxAppConsole@@UAEXPB_WH000@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(wchar_t const *,int,wchar_t const *,wchar_t const *)" (?OnAssert@wxAppConsole@@UAEXPB_WH00@Z)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall wxAuiManager::LoadPaneInfo(class wxString,class wxAuiPaneInfo &)" (?LoadPaneInfo@wxAuiManager@@$$FQAEXVwxString@@AAVwxAuiPaneInfo@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: class wxString __thiscall wxAuiManager::SavePaneInfo(class wxAuiPaneInfo &)" (?SavePaneInfo@wxAuiManager@@$$FQAE?AVwxString@@AAVwxAuiPaneInfo@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall wxAuiManager::Update(void)" (?Update@wxAuiManager@@$$FQAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxAuiManager::DetachPane(class wxWindow *)" (?DetachPane@wxAuiManager@@$$FQAE_NPAVwxWindow@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxAuiManager::AddPane(class wxWindow *,class wxAuiPaneInfo const &)" (?AddPane@wxAuiManager@@$$FQAE_NPAVwxWindow@@ABVwxAuiPaneInfo@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: class wxAuiPaneInfo & __thiscall wxAuiManager::GetPane(class wxWindow *)" (?GetPane@wxAuiManager@@$$FQAEAAVwxAuiPaneInfo@@PAVwxWindow@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall wxAuiManager::wxAuiManager(class wxWindow *,unsigned int)" (??0wxAuiManager@@$$FQAE@PAVwxWindow@@I@Z)
main.obj : error LNK2001: unresolved external symbol "public: class wxInputStream * __thiscall wxURL::GetInputStream(void)" (?GetInputStream@wxURL@@$$FQAEPAVwxInputStream@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall wxURL::wxURL(class wxString const &)" (??0wxURL@@$$FQAE@ABVwxString@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __thiscall wxAuiNotebookEvent::GetClassInfo(void)const " (?GetClassInfo@wxAuiNotebookEvent@@$$FUBEPAVwxClassInfo@@XZ)
main.obj : error LNK2001: unresolved external symbol "int const wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED" (?wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED@@3HB)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(wchar_t const *,int,wchar_t const *,wchar_t const *)" (?OnAssert@wxAppConsole@@$$FUAEXPB_WH00@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(wchar_t const *,int,wchar_t const *,wchar_t const *,wchar_t const *)" (?OnAssertFailure@wxAppConsole@@$$FUAEXPB_WH000@Z)
main.obj : error LNK2001: unresolved external symbol "int const wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE" (?wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE@@3HB)
main.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __thiscall wxSocketEvent::GetClassInfo(void)const " (?GetClassInfo@wxSocketEvent@@$$FUBEPAVwxClassInfo@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: int __thiscall wxAuiNotebook::GetSelection(void)const " (?GetSelection@wxAuiNotebook@@$$FQBEHXZ)
main.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall wxAuiNotebook::SetSelection(unsigned int)" (?SetSelection@wxAuiNotebook@@$$FQAEII@Z)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxAuiNotebook::SetPageText(unsigned int,class wxString const &)" (?SetPageText@wxAuiNotebook@@$$FQAE_NIABVwxString@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: int __thiscall wxAuiNotebook::GetPageIndex(class wxWindow *)const " (?GetPageIndex@wxAuiNotebook@@$$FQBEHPAVwxWindow@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: class wxWindow * __thiscall wxAuiNotebook::GetPage(unsigned int)const " (?GetPage@wxAuiNotebook@@$$FQBEPAVwxWindow@@I@Z)
main.obj : error LNK2001: unresolved external symbol "public: unsigned int __thiscall wxAuiNotebook::GetPageCount(void)const " (?GetPageCount@wxAuiNotebook@@$$FQBEIXZ)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxAuiNotebook::DeletePage(unsigned int)" (?DeletePage@wxAuiNotebook@@$$FQAE_NI@Z)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxAuiNotebook::AddPage(class wxWindow *,class wxString const &,bool,class wxBitmap const &)" (?AddPage@wxAuiNotebook@@$$FQAE_NPAVwxWindow@@ABVwxString@@_NABVwxBitmap@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall wxAuiNotebook::wxAuiNotebook(class wxWindow *,int,class wxPoint const &,class wxSize const &,long)" (??0wxAuiNotebook@@$$FQAE@PAVwxWindow@@HABVwxPoint@@ABVwxSize@@J@Z)
main.obj : error LNK2001: unresolved external symbol "void __cdecl wxOnAssert(wchar_t const *,int,char const *,wchar_t const *,wchar_t const *)" (?wxOnAssert@@$$FYAXPB_WHPBD00@Z)
main.obj : error LNK2001: unresolved external symbol "int g_isPainting" (?g_isPainting@@3HA)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall wxAuiPaneButtonArray::~wxAuiPaneButtonArray(void)" (??1wxAuiPaneButtonArray@@$$FQAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: class wxAuiPaneButtonArray & __thiscall wxAuiPaneButtonArray::operator=(class wxAuiPaneButtonArray const &)" (??4wxAuiPaneButtonArray@@$$FQAEAAV0@ABV0@@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __thiscall wxAuiManagerEvent::GetClassInfo(void)const " (?GetClassInfo@wxAuiManagerEvent@@$$FUBEPAVwxClassInfo@@XZ)
D:\Tibia\Souce\Map Editor\trunk\RmE\Release\RmE.exe : fatal error LNK1120: 34 unresolved externals
Build log was saved at "file://d:\Tibia\Souce\Test\trunk\Test\Source\Release\BuildLog.htm"
RmE - 35 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
which may be? I found something similar in topics.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linker erros in MVS 2008

Post by doublemax »

As the errors are related to wxAUI you probably forgot to add the wxAUI library to your linker input files.
E.g wxmsw28u_aui.lib
The exact filename depends on your wx version and whether you're using Unicode or ANSI build.
Use the source, Luke!
comedinha
In need of some credit
In need of some credit
Posts: 9
Joined: Thu May 24, 2012 10:46 pm

Re: Linker erros in MVS 2008

Post by comedinha »

I have fixed:
New Linkers:

Code: Select all

~wxbase28u.lib
wxbase28u_net.lib
wxbase28u_xml.lib
wxjpeg.lib
wxmsw28u_aui.lib
wxmsw28u_core.lib
wxmsw28u_gl.lib
wxpng.lib
wxzlib.lib
comctl32.lib
wsock32.lib
gdi32.lib
advapi32.lib
comdlg32.lib
shell32.lib
ole32.lib
oleaut32.lib
User32.lib
libxml2.lib
Errors:

Code: Select all

main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(wchar_t const *,int,wchar_t const *,wchar_t const *,wchar_t const *)" (?OnAssertFailure@wxAppConsole@@UAEXPB_WH000@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(wchar_t const *,int,wchar_t const *,wchar_t const *)" (?OnAssert@wxAppConsole@@UAEXPB_WH00@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(wchar_t const *,int,wchar_t const *,wchar_t const *)" (?OnAssert@wxAppConsole@@$$FUAEXPB_WH00@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(wchar_t const *,int,wchar_t const *,wchar_t const *,wchar_t const *)" (?OnAssertFailure@wxAppConsole@@$$FUAEXPB_WH000@Z)
main.obj : error LNK2001: unresolved external symbol "void __cdecl wxOnAssert(wchar_t const *,int,char const *,wchar_t const *,wchar_t const *)" (?wxOnAssert@@$$FYAXPB_WHPBD00@Z)
main.obj : error LNK2001: unresolved external symbol "int g_isPainting" (?g_isPainting@@3HA)
Definitions:

Code: Select all

__WINDOWS__
__WXMSW__
_DEBUG
__WIN95__
__WIN32__
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linker erros in MVS 2008

Post by doublemax »

Can you build the "minimal" sample that comes with wxWidgets?
Use the source, Luke!
comedinha
In need of some credit
In need of some credit
Posts: 9
Joined: Thu May 24, 2012 10:46 pm

Re: Linker erros in MVS 2008

Post by comedinha »

How so?
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linker erros in MVS 2008

Post by doublemax »

Go to <wxdir>/samples/minimal/ and open one of the Visual Studio solution files. Before building make sure to select the same configuration that you used when building the library.
Use the source, Luke!
comedinha
In need of some credit
In need of some credit
Posts: 9
Joined: Thu May 24, 2012 10:46 pm

Re: Linker erros in MVS 2008

Post by comedinha »

same error:

Code: Select all

------ Build started: Project: Minimal, Configuration: Release Win32 ------
Deleting intermediate and output files for project 'Minimal', configuration 'Release|Win32'
Compiling...
minimal.cpp
Linking...
minimal.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(wchar_t const *,int,wchar_t const *,wchar_t const *,wchar_t const *)" (?OnAssertFailure@wxAppConsole@@UAEXPB_WH000@Z)
minimal.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(wchar_t const *,int,wchar_t const *,wchar_t const *)" (?OnAssert@wxAppConsole@@UAEXPB_WH00@Z)
minimal.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(wchar_t const *,int,wchar_t const *,wchar_t const *)" (?OnAssert@wxAppConsole@@$$FUAEXPB_WH00@Z)
minimal.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(wchar_t const *,int,wchar_t const *,wchar_t const *,wchar_t const *)" (?OnAssertFailure@wxAppConsole@@$$FUAEXPB_WH000@Z)
minimal.obj : error LNK2001: unresolved external symbol "void __cdecl wxOnAssert(wchar_t const *,int,char const *,wchar_t const *,wchar_t const *)" (?wxOnAssert@@$$FYAXPB_WHPBD00@Z)
minimal.obj : error LNK2001: unresolved external symbol "int g_isPainting" (?g_isPainting@@3HA)
C:\wxWidgets-2.8.6\samples\minimal\Minimal\Release\Minimal.exe : fatal error LNK1120: 6 unresolved externals
Build log was saved at "file://c:\wxWidgets-2.8.6\samples\minimal\Minimal\Minimal\Release\BuildLog.htm"
Minimal - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
almost forgot
I put ignore specific library MSVCRT.lib
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linker erros in MVS 2008

Post by doublemax »

http://forums.wxwidgets.org/viewtopic.p ... 17#p142017
This describes how to build wx 2.9.x with VS 2010.

If you can, try with wx 2.9.x, if you're stuck with 2.8.x, you have to open wx.dsw and let VS convert it, as it doesn't come with project files for newer VS versions.

Apart from that, the steps should be the same when using VS2008.
Use the source, Luke!
comedinha
In need of some credit
In need of some credit
Posts: 9
Joined: Thu May 24, 2012 10:46 pm

Re: Linker erros in MVS 2008

Post by comedinha »

Is that in the changelog asks to use the 2.8.6+

I looked at the project and recreate it, was using CRL
New errors:

Code: Select all

------ Build started: Project: Test, Configuration: Release Win32 ------
Compiling...
pngfiles.cpp
main.cpp
Linking...
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(wchar_t const *,int,wchar_t const *,wchar_t const *)" (?OnAssert@wxAppConsole@@UAEXPB_WH00@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(wchar_t const *,int,wchar_t const *,wchar_t const *,wchar_t const *)" (?OnAssertFailure@wxAppConsole@@UAEXPB_WH000@Z)
main.obj : error LNK2001: unresolved external symbol "void __cdecl wxOnAssert(wchar_t const *,int,char const *,wchar_t const *,wchar_t const *)" (?wxOnAssert@@YAXPB_WHPBD00@Z)
D:\Tibia\Souce\Map Editor\trunk\Test\Release\Test.exe : fatal error LNK1120: 3 unresolved externals
Build log was saved at "file://d:\Tibia\Souce\Map Editor\trunk\Test\Release\BuildLog.htm"
RmE - 4 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I use 2.8.6
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linker erros in MVS 2008

Post by doublemax »

Try removing "_DEBUG" from the flags as you're linking the release libs.
Use the source, Luke!
comedinha
In need of some credit
In need of some credit
Posts: 9
Joined: Thu May 24, 2012 10:46 pm

Re: Linker erros in MVS 2008

Post by comedinha »

Same errors...

Code: Select all

main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssert(wchar_t const *,int,wchar_t const *,wchar_t const *)" (?OnAssert@wxAppConsole@@UAEXPB_WH00@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsole::OnAssertFailure(wchar_t const *,int,wchar_t const *,wchar_t const *,wchar_t const *)" (?OnAssertFailure@wxAppConsole@@UAEXPB_WH000@Z)
main.obj : error LNK2001: unresolved external symbol "void __cdecl wxOnAssert(wchar_t const *,int,char const *,wchar_t const *,wchar_t const *)" (?wxOnAssert@@YAXPB_WHPBD00@Z)
D:\Test\Souce\Map Editor\trunk\Test\Release\Test.exe : fatal error LNK1120: 3 unresolved externals
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linker erros in MVS 2008

Post by doublemax »

Then i don't know. Try asking the authors of the project you're trying to compile.
Use the source, Luke!
comedinha
In need of some credit
In need of some credit
Posts: 9
Joined: Thu May 24, 2012 10:46 pm

Re: Linker erros in MVS 2008

Post by comedinha »

The project is abandoned, no one has contact with the author
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linker erros in MVS 2008

Post by doublemax »

Can you post a link for the project?
Use the source, Luke!
comedinha
In need of some credit
In need of some credit
Posts: 9
Joined: Thu May 24, 2012 10:46 pm

Re: Linker erros in MVS 2008

Post by comedinha »

Post Reply