wxWidget 3.0 linking error while compiling my project in DEBUG mode  [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
Earned a small fee
Earned a small fee
Posts: 16
Joined: Thu Feb 22, 2018 10:37 am

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

Postby kyadav78 » Wed Feb 28, 2018 6:14 am

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
Earned a small fee
Earned a small fee
Posts: 16
Joined: Thu Feb 22, 2018 10:37 am

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

Postby kyadav78 » Wed Feb 28, 2018 7:54 am

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: 2678
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

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

Postby ONEEYEMAN » Wed Feb 28, 2018 4:03 pm

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
Earned a small fee
Earned a small fee
Posts: 16
Joined: Thu Feb 22, 2018 10:37 am

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

Postby kyadav78 » Thu Mar 01, 2018 5:07 am

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
Earned a small fee
Earned a small fee
Posts: 16
Joined: Thu Feb 22, 2018 10:37 am

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

Postby kyadav78 » Thu Mar 01, 2018 12:31 pm

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: 2678
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

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

Postby ONEEYEMAN » Thu Mar 01, 2018 4:10 pm

Hi,

Code: Select all

wxString mystring( tmpstr );


Thank you.

kyadav78
Earned a small fee
Earned a small fee
Posts: 16
Joined: Thu Feb 22, 2018 10:37 am

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

Postby kyadav78 » Thu Mar 01, 2018 5:53 pm

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: 2678
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

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

Postby ONEEYEMAN » Thu Mar 01, 2018 6:15 pm

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: 12681
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Postby doublemax » Thu Mar 01, 2018 6:22 pm

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
Earned a small fee
Earned a small fee
Posts: 16
Joined: Thu Feb 22, 2018 10:37 am

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

Postby kyadav78 » Fri Mar 02, 2018 1:52 am

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
Earned a small fee
Earned a small fee
Posts: 16
Joined: Thu Feb 22, 2018 10:37 am

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

Postby kyadav78 » Fri Mar 02, 2018 4:38 am

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
Earned a small fee
Earned a small fee
Posts: 16
Joined: Thu Feb 22, 2018 10:37 am

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

Postby kyadav78 » Fri Mar 02, 2018 6:45 am

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: 2678
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

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

Postby ONEEYEMAN » Fri Mar 02, 2018 3:47 pm

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

Thank you.


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 2 guests