xcode c++11 and libc++, wxWidgets 3.1.1
xcode c++11 and libc++, wxWidgets 3.1.1
I am running minimal project in the samples folder for OS X.
I am trying to add spdlog https://github.com/gabime/spdlog into the project. The error that I got was 'initializer_list' file not found. Then I tried to switch the project and wxcocoa.xcodeproj settings to c++11 and libc++ to resolve the issue.
Apple LLVM9.0 - Language - C++
C++ Language Dialect -> C++11 [-std=c++11]
C++ Standard Library -> libc++ (LLVM C++ standard library with C++ support)
The initializer_list error is still there and I have some additional cmath errors.
No member named 'signbit' in the global namespace
No member named 'fpclassify' in the global namespace; did you mean '__fpclassify'?
No member named 'isfinite' in the global namespace; did you mean 'finite'?
(and many more...)
Are there additional settings I need to make to work with c++11 and libc++ / resolve the issues?
I am trying to add spdlog https://github.com/gabime/spdlog into the project. The error that I got was 'initializer_list' file not found. Then I tried to switch the project and wxcocoa.xcodeproj settings to c++11 and libc++ to resolve the issue.
Apple LLVM9.0 - Language - C++
C++ Language Dialect -> C++11 [-std=c++11]
C++ Standard Library -> libc++ (LLVM C++ standard library with C++ support)
The initializer_list error is still there and I have some additional cmath errors.
No member named 'signbit' in the global namespace
No member named 'fpclassify' in the global namespace; did you mean '__fpclassify'?
No member named 'isfinite' in the global namespace; did you mean 'finite'?
(and many more...)
Are there additional settings I need to make to work with c++11 and libc++ / resolve the issues?
Re: xcode c++11 and libc++, wxWidgets 3.1.1
Hi,
What is the exact error message you received without C++11?
Is the file present on your system?
Did you link with all required framework?
After you switch to C++11, did you rebuild wx and then rebuild your application?
Thank you.
What is the exact error message you received without C++11?
Is the file present on your system?
Did you link with all required framework?
After you switch to C++11, did you rebuild wx and then rebuild your application?
Thank you.
Re: xcode c++11 and libc++, wxWidgets 3.1.1
If I included just spdlog.h the error that I got was
Then I switched to c++11 and libc++. wx rebuilt and the minimal project rebuilt. Then the following errors occurred:
.'initializer_list' file not found
Then I switched to c++11 and libc++. wx rebuilt and the minimal project rebuilt. Then the following errors occurred:
And 10 more other errors coming from cmath./Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:313:9: No member named 'signbit' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:314:9: No member named 'fpclassify' in the global namespace; did you mean '__fpclassify'?
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:315:9: No member named 'isfinite' in the global namespace; did you mean 'finite'?
Re: xcode c++11 and libc++, wxWidgets 3.1.1
Hi,
You need to re-configure and re-compile wx with c++11 mode.
Also, just curious - how exactly did you configure wx to be c++11 compatible? Please post an exact configure line.
Thank you.,
You need to re-configure and re-compile wx with c++11 mode.
Also, just curious - how exactly did you configure wx to be c++11 compatible? Please post an exact configure line.
Thank you.,
Re: xcode c++11 and libc++, wxWidgets 3.1.1
Ok, I will reconfigure and rebuild wx and then reinstall it.
To change the xCode project to c++11/libc++, I went to Build Settings (by highlighting wxcocoa.xcodeproj), scroll down to Apple LLVM 9.0 - Language - C++, selected C++11 [-std=c++11] under C++ Language Dialect. Then selected libc++ under C++ Standard Library.
I will report back after the rebuild. Thanks for the help.
To change the xCode project to c++11/libc++, I went to Build Settings (by highlighting wxcocoa.xcodeproj), scroll down to Apple LLVM 9.0 - Language - C++, selected C++11 [-std=c++11] under C++ Language Dialect. Then selected libc++ under C++ Standard Library.
I will report back after the rebuild. Thanks for the help.
Re: xcode c++11 and libc++, wxWidgets 3.1.1
I rebuilt everything and recompiled the project and same cmath errors listed above.
Re: xcode c++11 and libc++, wxWidgets 3.1.1
Hi,
What is the exact configure line you used to build the library?
You can take it from the config.log file that can be found inside the build directory.
Thank you.
What is the exact configure line you used to build the library?
You can take it from the config.log file that can be found inside the build directory.
Thank you.
Re: xcode c++11 and libc++, wxWidgets 3.1.1
$ ../configure CFLAGS= CXXFLAGS=-std=c++11 -stdlib=libc++ CPPFLAGS=-stdlib=libc++ OBJCFLAGS= OBJCXXFLAGS=-std=c++11 -stdlib=libc++ LDFLAGS=-stdlib=libc++ --disable-shared
This seemed to have worked. I did not see any errors. I think what I am really after is how do I build the "minimal" project with c++11/libc++ in Xcode.
This seemed to have worked. I did not see any errors. I think what I am really after is how do I build the "minimal" project with c++11/libc++ in Xcode.
Re: xcode c++11 and libc++, wxWidgets 3.1.1
I made the following changes to the project settings and it built the static library without issues. But building the executable I ran in to the math errors.
In wxcocoa.xcoconfig:
MACOSX_DEPLOYMENT_TARGET = 10.9 // changed from 10.7 to 10.9
OTHER_LDFLAGS = -framework WebKit -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework OpenGL -framework AVFoundation -framework CoreMedia -framework Security -weak_framework AVKit -std=c++11 -stdlib=libc++
In the project Build Settings:
C++ Language Dialect->C++11
C++ Standard Library->libc++
Math errors in cmath.h:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:313:9: No member named 'signbit' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:314:9: No member named 'fpclassify' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:315:9: No member named 'isfinite' in the global namespace; did you mean 'finite'?
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:316:9: No member named 'isinf' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:317:9: No member named 'isnan' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:318:9: No member named 'isnormal' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:319:7: No member named 'isgreater' in the global namespace; did you mean '::std::greater'?
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:320:7: No member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:321:9: No member named 'isless' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:322:9: No member named 'islessequal' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:323:9: No member named 'islessgreater' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:324:9: No member named 'isunordered' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:325:9: No member named 'isunordered' in the global namespace
Dependency order issue?
In wxcocoa.xcoconfig:
MACOSX_DEPLOYMENT_TARGET = 10.9 // changed from 10.7 to 10.9
OTHER_LDFLAGS = -framework WebKit -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework OpenGL -framework AVFoundation -framework CoreMedia -framework Security -weak_framework AVKit -std=c++11 -stdlib=libc++
In the project Build Settings:
C++ Language Dialect->C++11
C++ Standard Library->libc++
Math errors in cmath.h:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:313:9: No member named 'signbit' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:314:9: No member named 'fpclassify' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:315:9: No member named 'isfinite' in the global namespace; did you mean 'finite'?
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:316:9: No member named 'isinf' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:317:9: No member named 'isnan' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:318:9: No member named 'isnormal' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:319:7: No member named 'isgreater' in the global namespace; did you mean '::std::greater'?
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:320:7: No member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:321:9: No member named 'isless' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:322:9: No member named 'islessequal' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:323:9: No member named 'islessgreater' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:324:9: No member named 'isunordered' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:325:9: No member named 'isunordered' in the global namespace
Dependency order issue?
Re: xcode c++11 and libc++, wxWidgets 3.1.1
Issue resolved:
Had "/usr/local/include" in "System Header Search Paths" by mistake. Moved the path to "User Header Search Paths" fixed the issue.
Thanks for all the help.
Had "/usr/local/include" in "System Header Search Paths" by mistake. Moved the path to "User Header Search Paths" fixed the issue.
Thanks for all the help.