#13 failure to build on OS X 10.9; wxcrt.h error: call to 'wcsstr' is ambiguous

Next_Release
open
None
Bug_Report
2016-03-30
2014-05-30
No

Code::Blocks fails to compile on OS X 10.9 / Mavericks.

This is the error:

/bin/sh ../../../libtool  --tag=CXX   --mode=compile /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I../../../src/include  -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/lib/wx/include/osx_cocoa-unicode-3.0 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__  -I../../../src/plugins/astyle/astyle -I../../../src/include -I../../../src/sdk/wxscintilla/include -I/opt/local/include -ansi -DTIXML_USE_STL  -O2 -ffast-math -DCB_AUTOCONF -pipe -Os -arch x86_64 -stdlib=libc++ -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT ASResource.lo -MD -MP -MF .deps/ASResource.Tpo -c -o ASResource.lo `test -f 'astyle/ASResource.cpp' || echo './'`astyle/ASResource.cpp
libtool: compile:  /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/lib/wx/include/osx_cocoa-unicode-3.0 -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ -I../../../src/plugins/astyle/astyle -I../../../src/include -I../../../src/sdk/wxscintilla/include -I/opt/local/include -ansi -DTIXML_USE_STL -O2 -ffast-math -DCB_AUTOCONF -pipe -Os -arch x86_64 -stdlib=libc++ -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT ASResource.lo -MD -MP -MF .deps/ASResource.Tpo -c astyle/ASResource.cpp  -fno-common -DPIC -o .libs/ASResource.o
In file included from dlgformattersettings.cpp:12:
In file included from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/radiobut.h:33:
In file included from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/control.h:22:
In file included from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/window.h:18:
In file included from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/event.h:16:
In file included from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/object.h:19:
In file included from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/memory.h:15:
In file included from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/string.h:4305:
In file included from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/crt.h:19:
/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/wxcrt.h:577:14: error: call to 'wcsstr' is ambiguous
    { return wxCRT_StrstrW(haystack, needle); }
             ^~~~~~~~~~~~~
/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/wxcrtbase.h:155:26: note: expanded from macro 'wxCRT_StrstrW'
#define wxCRT_StrstrW    wcsstr
                         ^~~~~~
/usr/include/wchar.h:141:10: note: candidate function
wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict);
         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cwchar:189:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);}
                                                ^

You can see the complete build log at https://build.macports.org/builders/buildports-mavericks-x86_64/builds/3766
Click on stdio under compile to see the log.

You might also want to check other relevant warnings to see if you could fix any of them easily.

There is a chance that the problem is in wxWidgets, but even in that case I would like to ask you for a bit of help.

Discussion

  • Morten MacFly

    Morten MacFly - 2015-02-07
    • Type: --> Undefined
     
  • Morten MacFly

    Morten MacFly - 2015-05-02

    It looks to me like a wx issue, in fact., what exact wx version do you use? wx v3.0.0, v3.0.2? Can you try with a more recent version, please?

     
  • Morten MacFly

    Morten MacFly - 2015-05-02
    • assigned_to: Morten MacFly
    • Type: Undefined --> Bug_Report
     
  • Mojca Miklavec

    Mojca Miklavec - 2015-05-02

    Thanks a lot for the link.

    I don't have 10.9 or 10.10 at hand, but I'll wait for your latest patches to appear on the (unofficial) source mirror at GitHub and then try to submit a build of the latest version from trunk to our buildbots + ask fellow developers with the latest OS to check whether this is still broken. (I will wait for GitHub because checking out the SVN sources has some drawbacks related to some very inefficient implementation of our package management system.)

    I reported this more than a year ago and the version of wxWidgets probably changed during the last year (we current have the latest version available/installed, 3.0.2), so there is some minor chance that a bug in wxWidgets would be resolved in the meantime.

     
  • Mojca Miklavec

    Mojca Miklavec - 2015-05-02

    The latest version now fails with

    In file included from debuggergdb.cpp:10:
    In file included from ../../../src/include/sdk.h:17:
    In file included from ../../../src/include/sdk_precomp.h:13:
    In file included from ../../../src/include/sdk_common.h:43:
    ../../../src/include/prep.h:33:75: error: use of overloaded operator '==' is ambiguous (with operand types 'const std::__1::shared_ptr<GDBWatch>' and 'int')
            template<typename T> bool equals(T const& rhs) const { return rhs == 0; }
                                                                          ~~~ ^  ~
    

    So I don't know if the problem mentioned above is still an issue or not. I'll open a separate ticket for the above mentioned issue, but I will try to figure out if there is some easy solution first.

     
  • Mojca Miklavec

    Mojca Miklavec - 2016-03-30

    I opened #322 for the second issue. I don't know if the original issue is still a problem or not. I don't know enough C++ to debug myself.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks