New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation of wxFormBuilder is broken on modern Macs #247

Open
jpd236 opened this Issue Oct 11, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@jpd236

jpd236 commented Oct 11, 2016

On a modern Mac (macOS Sierra, XCode 8), I've encountered the following build issues when trying to build:

  • wx-config isn't actually invoked as expected when compiling; for some reason the backticks don't appear to be working. I can work around this by manually running the wx-config commands and editing the build/linkoptions in build/premake/wxwidgets.lua but I'm not sure how to get it to work dynamically as intended in all environments. Here's the error:
CompileC obj/Debug/plugin-interface/plugin-interface.build/Objects-normal/x86_64/xrcconv.o /Users/jeff/Documents/Code/wxFormBuilder/sdk/plugin_interface/xrcconv.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/jeff/Documents/Code/wxFormBuilder/build/3.1/xcode3
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=152 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DUNICODE -D_UNICODE -DDEBUG -D_DEBUG -DTIXML_USE_TICPP -D__WXDEBUG__ -DWXUSINGDLL -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.12 -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -iquote /Users/jeff/Documents/Code/wxFormBuilder/build/3.1/xcode3/obj/Debug/plugin-interface/plugin-interface.build/wx_macud_plugin-interface-3.1-generated-files.hmap -I/Users/jeff/Documents/Code/wxFormBuilder/build/3.1/xcode3/obj/Debug/plugin-interface/plugin-interface.build/wx_macud_plugin-interface-3.1-own-target-headers.hmap -I/Users/jeff/Documents/Code/wxFormBuilder/build/3.1/xcode3/obj/Debug/plugin-interface/plugin-interface.build/wx_macud_plugin-interface-3.1-all-target-headers.hmap -iquote /Users/jeff/Documents/Code/wxFormBuilder/build/3.1/xcode3/obj/Debug/plugin-interface/plugin-interface.build/wx_macud_plugin-interface-3.1-project-headers.hmap -I/Users/jeff/Documents/Code/wxFormBuilder/sdk/lib/include -I../../../sdk/tinyxml -I/Users/jeff/Documents/Code/wxFormBuilder/build/3.1/xcode3/obj/Debug/plugin-interface/plugin-interface.build/DerivedSources/x86_64 -I/Users/jeff/Documents/Code/wxFormBuilder/build/3.1/xcode3/obj/Debug/plugin-interface/plugin-interface.build/DerivedSources -Wall -F/Users/jeff/Documents/Code/wxFormBuilder/sdk/lib -Wno-overloaded-virtual -O0 -fPIC `/Users/jeff/Documents/Code/wxWidgets-3.1.0/build-wxFormBuilder/wx-config --debug=yes --static=no --unicode=yes --cxxflags` -MMD -MT dependencies -MF /Users/jeff/Documents/Code/wxFormBuilder/build/3.1/xcode3/obj/Debug/plugin-interface/plugin-interface.build/Objects-normal/x86_64/xrcconv.d --serialize-diagnostics /Users/jeff/Documents/Code/wxFormBuilder/build/3.1/xcode3/obj/Debug/plugin-interface/plugin-interface.build/Objects-normal/x86_64/xrcconv.dia -c /Users/jeff/Documents/Code/wxFormBuilder/sdk/plugin_interface/xrcconv.cpp -o /Users/jeff/Documents/Code/wxFormBuilder/build/3.1/xcode3/obj/Debug/plugin-interface/plugin-interface.build/Objects-normal/x86_64/xrcconv.o
clang: error: unsupported option '--static=no'
clang: error: unsupported option '--unicode=yes'
clang: error: unsupported option '--cxxflags`'
clang: error: no such file or directory: '`/Users/jeff/Documents/Code/wxWidgets-3.1.0/build-wxFormBuilder/wx-config'
  • The default wxWidgets (3.1.0) build uses libstdc++ because it sets -mmacosx-version-min=10.7 in build/link options. In contrast, wxFormBuilder sets nothing, which means it sets the minimum version to the platform version (in my case, 10.12), which fails because it uses libc++ which is not compatible. The precise error is: fatal error: 'tr1/type_traits' file not found. This can be fixed by manually adding the same minimum OS X version to build/linkoptions.
  • Passing -architecture=i386 wasn't sufficient as the build still tried linking as x86_64. I ended up using a 64-bit build of wxWidgets to work around this.
@seppestas

This comment has been minimized.

Show comment
Hide comment
@seppestas

seppestas Nov 9, 2016

For me (macOS Sierra 10.12.1) the wx-config scripts in create_build_files4.sh seem to work fine. Did you specify the wxWidgets build path when invoking create_build_files4.sh?

I do seem to have some problems with wxMedia though.

seppestas commented Nov 9, 2016

For me (macOS Sierra 10.12.1) the wx-config scripts in create_build_files4.sh seem to work fine. Did you specify the wxWidgets build path when invoking create_build_files4.sh?

I do seem to have some problems with wxMedia though.

@jpd236

This comment has been minimized.

Show comment
Hide comment
@jpd236

jpd236 Nov 10, 2016

Yes, like:

./create_build_files4.sh --wx-root=/Users/jeff/Documents/Code/wxWidgets-3.1.0/build-wxFormBuilder

That's the precise command that led to the error noted above. You can see the path shows up in the clang invocation above, here:

/Users/jeff/Documents/Code/wxWidgets-3.1.0/build-wxFormBuilder/wx-config --debug=yes --static=no --unicode=yes --cxxflags

if I run that command manually (without backticks), it works fine and outputs the compiler options its supposed to, but when running xcodebuild to try and build the generated xcodeproj files, I get the above error which indicates that the backticks aren't working.

jpd236 commented Nov 10, 2016

Yes, like:

./create_build_files4.sh --wx-root=/Users/jeff/Documents/Code/wxWidgets-3.1.0/build-wxFormBuilder

That's the precise command that led to the error noted above. You can see the path shows up in the clang invocation above, here:

/Users/jeff/Documents/Code/wxWidgets-3.1.0/build-wxFormBuilder/wx-config --debug=yes --static=no --unicode=yes --cxxflags

if I run that command manually (without backticks), it works fine and outputs the compiler options its supposed to, but when running xcodebuild to try and build the generated xcodeproj files, I get the above error which indicates that the backticks aren't working.

@jpd236

This comment has been minimized.

Show comment
Hide comment
@jpd236

jpd236 Nov 10, 2016

OK, I got a build working using the gmake makefiles instead of the xcode project files. So the issue with the backticks only affects xcodebuild (not sure about the other two sets of project files generated by the script).

I still needed to run:

CFLAGS="-mmacosx-version-min=10.7 " LDFLAGS="-mmacosx-version-min=10.7" make

as noted above to get the libstdc++ instead of libc++. And yes, I used --disable-mediactrl as it did not compile with it enabled.

jpd236 commented Nov 10, 2016

OK, I got a build working using the gmake makefiles instead of the xcode project files. So the issue with the backticks only affects xcodebuild (not sure about the other two sets of project files generated by the script).

I still needed to run:

CFLAGS="-mmacosx-version-min=10.7 " LDFLAGS="-mmacosx-version-min=10.7" make

as noted above to get the libstdc++ instead of libc++. And yes, I used --disable-mediactrl as it did not compile with it enabled.

@seppestas

This comment has been minimized.

Show comment
Hide comment
@seppestas

seppestas Nov 10, 2016

Ow, I think I know what the problem is.
At create_build_files4.sh:7 wx-config get's executed regardless of wxroot being set. This means that if you do not have wxWidgets installed on your system the command will fail.

As far as I can tell, the command is only executed to enable the help menu to tell where wxWidgets is installed. IMO this could be ditched, or a check would be made to see if executing wx-config succeeded, and if not, set a message stating the path is not found.

wxpath=`wx-config --prefix 2>/dev/null || echo "not found"`

seppestas commented Nov 10, 2016

Ow, I think I know what the problem is.
At create_build_files4.sh:7 wx-config get's executed regardless of wxroot being set. This means that if you do not have wxWidgets installed on your system the command will fail.

As far as I can tell, the command is only executed to enable the help menu to tell where wxWidgets is installed. IMO this could be ditched, or a check would be made to see if executing wx-config succeeded, and if not, set a message stating the path is not found.

wxpath=`wx-config --prefix 2>/dev/null || echo "not found"`
@jpd236

This comment has been minimized.

Show comment
Hide comment
@jpd236

jpd236 Nov 10, 2016

I noticed that but don't think it's the problem. Scripts will keep going after an error by default unless you call "set -e" manually to have them fail on an error. I get the error due to wx-config not being found but it still continues to call premake and ultimately builds the correct path from the --wx-root flag.

jpd236 commented Nov 10, 2016

I noticed that but don't think it's the problem. Scripts will keep going after an error by default unless you call "set -e" manually to have them fail on an error. I get the error due to wx-config not being found but it still continues to call premake and ultimately builds the correct path from the --wx-root flag.

@jhasse jhasse added the macOS label Dec 14, 2016

@jhasse jhasse referenced this issue Jan 26, 2017

Closed

Binary for macOS #271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment