1

I am trying to to compile wxWidgets 3.0.2 found here.

I need this library, so that I can compile SimSpark. I have tried installing the library via MacPorts - this does work. But when I try to compile SimSpark, the compiler states the following:

In file included from /opt/local/include/gcc49/c++/type_traits:35:0,
             from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/strvararg.h:25,
             from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/string.h:46,
             from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/memory.h:15,
             from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/object.h:19,
             from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/event.h:16,
             from /Users/YEED/Downloads/simspark-0.2.4/plugin/inputwx/inputwx.cpp:23:
/opt/local/include/gcc49/c++/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

I believe that I need to compile wxWidgets with C++11 support, since I already included the C++11 relevant flags when making SimSpark.

When I try to compile wxWidgets, I get a bunch of compiler errors that refer to the same .h file - which is part of CoreFoundation:

In file included from /usr/include/Availability.h:184:0,
             from /usr/include/stdlib.h:61,
             from /usr/include/assert.h:44,
             from ../include/wx/debug.h:13,
             from ../include/wx/defs.h:743,
             from ../include/wx/wxprec.h:12,
             from ../src/common/filefn.cpp:20:
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:53:34: error: expected '}' before '__attribute__'
 kCFISO8601DateFormatWithYear API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = (1UL << 0),

When you look into that specific file, there are a bunch of lines that miss a closing ) and resemble the one printed by the compiler as well. (There should be a closing ) before the comma at the end of the line, right?)

So my question is, is this an actual error in CoreFoundation? If so, how can I fix this or work around it? Or am I actually completely misunderstanding the compiler error thrown when compiling SimSpark in the first place?

EDIT: I couldn't get wxWidgets to compile, but I have fixed my issues compiling SimSpark with the MacPorts version of wxWidgets. The problem lay within using different compilers (gcc and clang) for the two.

yeed
  • 71
  • 8
  • Please, show the command you use to compile wxWidgets 3.0.2. And make sure you add c++11 flag. – Ripi2 Dec 14 '16 at 15:29
  • @030, also make sure you added c++11 support to CXXFLAGS. – Igor Dec 14 '16 at 16:32
  • mkdir build; cd build; cmake ..; make CXXFLAGS=-std=gnu++11 or CXXFLAGS="-std=gnu++11" (makes no difference) – yeed Dec 14 '16 at 16:50
  • Not a Cmake expert, but are you sure it honours `CXXFLAGS` specified like this? From the error message it's clear that the compiler does **not** use C++11, you need to fix this. – VZ. Dec 14 '16 at 19:56
  • Take a look at my post: http://stackoverflow.com/questions/37311147/error-is-enum-not-declared-in-this-scope-when-trying-to-compile-my-wxwidgets-p/37312088#37312088 – macroland Dec 15 '16 at 03:09
  • Yes, the makefile does use the flags that you provide with CXXFLAGS, but I also tried putting it inside cmake. the wxWidgets cmake takes CXXFLAGS from the environment variable $CXXFLAGS - that didn't make a difference. But for clarification: SimSpark compilation tells me that C++11 is necessary (wxWidgets needs it, I guess, since error thrown when using wxWidgets) - wxWidgets compilation tells me something about CoreFoundation having erroneous code, no matter if C++11 or not. – yeed Dec 15 '16 at 09:59

0 Answers0