wxString::Format(wxT("%d"), ijk) error 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.
Post Reply
mybofy
Knows some wx things
Knows some wx things
Posts: 38
Joined: Fri Aug 07, 2015 2:09 pm

wxString::Format(wxT("%d"), ijk) error

Post by mybofy »

Bonjour
macOS 10.13 - Xcode 9 - wxWidgets 3.1.0

Build "libwx_osx_cocoa.dylib" via ".../wxWidgets-3.1.0/build/osx/wxcocoa.xcodeproj"
OK after
"verify_noerr" to "__Verify_noErr" and "#define wxOSX_USE_QTKIT 1" to "#define wxOSX_USE_QTKIT 0"

Create Xcode project "wxHello" from example "http://docs.wxwidgets.org/trunk/overvie ... world.html"

OK, after inserting flags in Xcode > Other C++ Flags (NB: the method used does not provide wx-config !)

Problem : "wxString::Format(wxT("%d"), ijk);" cause error :
"Undefined symbols for architecture x86_64:
"_wxCRT_StrlenW", referenced from:
wxStrlen(wchar_t const*) in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)"


NB: remplacing by "wxString(to_string(ijk))" is OK

Help please

Merci
Nunki
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 235
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: wxString::Format(wxT("%d"), ijk) error

Post by Nunki »

Hi,

First of all, I think the wxT macro is obsolete, or wil become so.
Note that since wxWidgets 2.9.0 you shouldn't use wxT() anymore in your program sources (it was previously required if you wanted to support Unicode).
(taken from the wxWidgets 3.0.3 online documentation.

Second, you work on a Mac with xcode. and the error says something about architecture X86_64 which is normal to windows environments. So encountering susch a strange error description my experience tells me almost always this is caused by a missing header file. So I would advise you to re-examine your code to make sure all functions used like strlen which may be used in wxString::Format is included in any way by headers.

Third, do you need to declare some constants like I had to do in my VisualStudio environment (wxMSVC_VERSION_AUTO, WXUSINGDLL) Maybe you need to set such flags too for Mac development ?

Good luck

Regards,
Nunki
mybofy
Knows some wx things
Knows some wx things
Posts: 38
Joined: Fri Aug 07, 2015 2:09 pm

Re: wxString::Format(wxT("%d"), ijk) error

Post by mybofy »

You are right :
"wxString::Format("%d", ijk);"
works !

Merci
Post Reply