wxWidget 3.0 linking error while compiling my project in DEBUG mode 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.
kyadav78
Knows some wx things
Knows some wx things
Posts: 29
Joined: Thu Feb 22, 2018 10:37 am

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by kyadav78 »

Hi,
wxWidget and my project setting are same only. Also this error is coming from only one file "MimeEncoderApp.obj", so i am suspecting some where in my code something is wrong.
Please note i am upgrading wxWidget from 2.8 to 3.0 version.

Regards
Kunal
kyadav78
Knows some wx things
Knows some wx things
Posts: 29
Joined: Thu Feb 22, 2018 10:37 am

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by kyadav78 »

Hi
My project initially was working with wxwdget2.8. Now i am trying to upgrade my project with wxwidget3.0.
Regards
Kunal
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by ONEEYEMAN »

Hi,
Is it a console application (not a GUI one)?
In this case please open the console sample project and compare the settings with your own project.
Also try to build the console sample. Does it build and run successfully?

Thank you.
kyadav78
Knows some wx things
Knows some wx things
Posts: 29
Joined: Thu Feb 22, 2018 10:37 am

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by kyadav78 »

Hi,
Problem solved!!!!
i have added "wxDEBUG_LEVEL=0" in my project preprocessor definition and below error gone. :)

1>MimeEncoderApp.obj : error LNK2001: unresolved external symbol "void __cdecl wxOnAssert(char const *,int,char const *,char const *,unsigned short const *)" (?wxOnAssert@@YAXPBDH00PBG@Z)
2>MimeEncoderApp.obj : 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)
3>MimeEncoderApp.obj : error LNK2001: unresolved external symbol "bool wxTrapInAssert" (?wxTrapInAssert@@3_NA)
4>MimeEncoderApp.obj : error LNK2001: unresolved external symbol "class wxMBConvStrictUTF8 * wxConvUTF8Ptr" (?xConvUTF8Ptr@@3PAVwxMBConvStrictUTF8@@A)


Regards
Kunal
kyadav78
Knows some wx things
Knows some wx things
Posts: 29
Joined: Thu Feb 22, 2018 10:37 am

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by kyadav78 »

Hi,
I am facing one litle problem while creating a object of wxString from std::string in wxWidget3.0?

Code snippet:
std::string tmpstr="AAAAA";
wxString mystring(tmpstr.c_str());//Error : Line 1
wxString(tmpstr.c_str(),wxConvUTF8);//Error:LINE 2

Error:
Error 1261 error LNK2019: unresolved external symbol "private: static struct wxString::SubstrBufFromType<class wxScopedCharTypeBuffer<unsigned short> > __cdecl wxString::ConvertStr(char const *,unsigned int,class wxMBConv const &)" (?ConvertStr@wxString@@CA?AU?$SubstrBufFromType@V?$wxScopedCharTypeBuffer@G@@@1@PBDIABVwxMBConv@@@Z) referenced in function "private: static class wxScopedCharTypeBuffer<unsigned short> __cdecl wxString::ImplStr(char const *,class wxMBConv const &)" (?ImplStr@wxString@@CA?AV?$wxScopedCharTypeBuffer@G@@PBDABVwxMBConv@@@Z)

How could i create a wxString object from std:String?
Regards
Kunal
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by ONEEYEMAN »

Hi,

Code: Select all

wxString mystring( tmpstr );
Thank you.
kyadav78
Knows some wx things
Knows some wx things
Posts: 29
Joined: Thu Feb 22, 2018 10:37 am

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by kyadav78 »

Hi,
I tried that but it is not working and giving same errors.
I think some wxString constructor got changed in 3.0.
Regards
Kunal
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by ONEEYEMAN »

Hi,
Which libraries you are trying to link? Please copy-n-paste the list exactly as it appears on the project proeprties or in the link command.
Also - are you building in C++11 mode?

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by doublemax »

Please take the "minimal" sample and paste those three lines into it at a reasonable location and check if you get the same errors.

I still believe there is something broken in your project regarding UNICODE.
Use the source, Luke!
kyadav78
Knows some wx things
Knows some wx things
Posts: 29
Joined: Thu Feb 22, 2018 10:37 am

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by kyadav78 »

Hi,
I am building my app in visual studio 2013, which has vc12.
Thw wxString initialization hsing wstring is working corrrctly. I dont understand why it does not work with string class though wxstrimg has that constructor still it is throwing error. The wxwidget is build in unicode and my app is also using unicode.
Please provide some solution.

Regards
Kunal
kyadav78
Knows some wx things
Knows some wx things
Posts: 29
Joined: Thu Feb 22, 2018 10:37 am

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by kyadav78 »

Hi,
My project using below list of libraries:
wxbase30u.lib
wxbase30u_net.lib
wxbase30u_xml.lib
wxzlib.lib
wxexpat.lib
Ws2_32.lib
urlmon.lib
wininet.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib

Regards
Kunal
kyadav78
Knows some wx things
Knows some wx things
Posts: 29
Joined: Thu Feb 22, 2018 10:37 am

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by kyadav78 »

Hi,
Problem is solved. I was using dynamic wxWidget library , i should have used statid liobrayr.
Regards
Kunal
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxWidget 3.0 linking error while compiling my project in DEBUG mode

Post by ONEEYEMAN »

Hi,
Even with the dynamic linking that error(s) shouldn't manifest.
You just changed the dynamic -> static, nothing else?

Thank you.
Post Reply