Build errors for iOS on OSX Mavericks / XCode6

Oct 2, 2014 at 1:53 PM
Edited Oct 2, 2014 at 3:02 PM
Hi,

I have followed the instructions on:
https://casablanca.codeplex.com/wikipage?title=Setup%20and%20Build%20on%20IOS&referringTitle=Documentation

At first the boost build was failing, but I managed to get around that by switching the OSX SDK version to 8.0 (see https://casablanca.codeplex.com/discussions/568721).

I then encountered errors similar to the ones mentioned in this thread:
https://casablanca.codeplex.com/discussions/567435
Namely mem_fn_template.hpp:271:43: error: no matching function for call to ‘get_pointer...

I also tried building boost 1.56 (rather than the latest sources), but the Casablanca build failed with the errors below.
The full log can be found at: http://pastebin.com/fH9UFNZi

Boost 1.55 and 1.54 wouldn't build at all, due to what appear to be SDK related errors:
_./boost.sh: line 125: /Users/ohads/Downloads/boost/cpprest/casablanca/Build_iOS/boostoniphonegal/boost/tools/build/src/user-config.jam: No such file or directory
link.jam: No such file or directory
/Users/ohads/Downloads/boost/cpprest/casablanca/Build_iOS/boostoniphonegal/boost/tools/build/v2/build/feature.jam:493: in validate-value-string from module feature
error: "iphone-8.0" is not a known value of feature <macosx-version>
error: legal values:_

Changing back the SDK to 7.0 didn't help (same error but with "iphone-7.0").

Any help would be appreciated!

Thanks,
Ohad

CompileC /Users/ohads/Downloads/boost/cpprest/casablanca/Build_iOS/build.ios/build.arm/src/casablanca.build/Release-iphoneos/cpprest.build/Objects-normal/armv7s/ws_client.o src/websockets/client/ws_client.cpp normal armv7s c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/ohads/Downloads/boost/cpprest/casablanca/Release
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/ohads/Downloads/TEE-CLC-12.0.1:/Users/ohads:/Users/ohads/cf:/opt/X11/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch armv7s -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -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 -Wno-unused-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 -DCMAKE_INTDIR=\"Release-iphoneos\" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -miphoneos-version-min=8.0 -I/Users/ohads/Downloads/boost/cpprest/casablanca/Build_iOS/build.ios/build.arm/Binaries/Release/include -I/Users/ohads/Downloads/boost/cpprest/casablanca/Release/include -I/Users/ohads/Downloads/boost/cpprest/casablanca/Release/../Build_iOS/boost.framework/Headers -I/Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp -I/Users/ohads/Downloads/boost/cpprest/casablanca/Release/src/../include -I/Users/ohads/Downloads/boost/cpprest/casablanca/Release/src/pch -I/Users/ohads/Downloads/boost/cpprest/casablanca/Release/../Build_iOS/openssl/include -I/Users/ohads/Downloads/boost/cpprest/casablanca/Build_iOS/build.ios/build.arm/src/casablanca.build/Release-iphoneos/cpprest.build/DerivedSources/armv7s -I/Users/ohads/Downloads/boost/cpprest/casablanca/Build_iOS/build.ios/build.arm/src/casablanca.build/Release-iphoneos/cpprest.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/ohads/Downloads/boost/cpprest/casablanca/Build_iOS/build.ios/build.arm/Binaries/Release -fvisibility=hidden -fvisibility-inlines-hidden -stdlib=libc++ -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration -std=c++11 -fno-strict-aliasing -Wall -Wextra -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls -Wno-overloaded-virtual -Wno-sign-conversion -Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-char-subscripts -Wno-switch -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated -Wno-unused-value -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-unused-function -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-reorder -Werror -pedantic -MMD -MT dependencies -MF /Users/ohads/Downloads/boost/cpprest/casablanca/Build_iOS/build.ios/build.arm/src/casablanca.build/Release-iphoneos/cpprest.build/Objects-normal/armv7s/ws_client.d --serialize-diagnostics /Users/ohads/Downloads/boost/cpprest/casablanca/Build_iOS/build.ios/build.arm/src/casablanca.build/Release-iphoneos/cpprest.build/Objects-normal/armv7s/ws_client.dia -c /Users/ohads/Downloads/boost/cpprest/casablanca/Release/src/websockets/client/ws_client.cpp -o /Users/ohads/Downloads/boost/cpprest/casablanca/Build_iOS/build.ios/build.arm/src/casablanca.build/Release-iphoneos/cpprest.build/Objects-normal/armv7s/ws_client.o
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/src/websockets/client/ws_client.cpp:43:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/config/asio_no_tls_client.hpp:31:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/config/core_client.hpp:51:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/message_buffer/message.hpp:32:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/frame.hpp:35:
/Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/common/network.hpp:53:17: error: expected ')'
inline uint64_t htonll(uint64_t src) {

In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/src/websockets/client/ws_client.cpp:43:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/config/asio_no_tls_client.hpp:31:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/config/core_client.hpp:51:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/message_buffer/message.hpp:32:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/frame.hpp:35:
/Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/common/network.hpp:74:17: error: redefinition of '__builtin_constant_p'
inline uint64_t ntohll(uint64_t src) {

In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/src/websockets/client/ws_client.cpp:43:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/config/asio_no_tls_client.hpp:31:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/config/core_client.hpp:51:
In file included from /Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/message_buffer/message.hpp:32:
/Users/ohads/Downloads/boost/cpprest/casablanca/Release/libs/websocketpp/websocketpp/frame.hpp:270:30: error: unexpected parenthesis after '::'
    temp64.i = lib::net::htonll(payload_size);
Oct 3, 2014 at 6:21 PM
Same here.
Coordinator
Oct 8, 2014 at 7:25 PM
Hi,

This issue should be fixed in the development branch. Please check it out and let us know if it solves the problem!

Note: you may need to rebuild boost.framework.

Sincerely,
roschuma
Oct 21, 2014 at 9:55 AM
I can confirm the issue is fixed (only tested on boost 1.56 though), great job!
Oct 28, 2014 at 11:30 PM
Hi.

On OSX Yosemite, with Xcode 6.1, and on the Development branch, i' still having a bunch of errors:
In file included from /Users/wILL/Documents/casablanca/Release/tests/functional/websockets/utilities/test_websocket_server.cpp:55:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/config/asio_no_tls.hpp:31:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/config/core.hpp:47:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/message_buffer/message.hpp:32:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/frame.hpp:35:
/Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/common/network.hpp:53:17: error: expected ')'
inline uint64_t htonll(uint64_t src) {
                ^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:30: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
                             ^
/Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/common/network.hpp:53:17: note: to match this '('
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
    ^
In file included from /Users/wILL/Documents/casablanca/Release/tests/functional/websockets/utilities/test_websocket_server.cpp:55:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/config/asio_no_tls.hpp:31:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/config/core.hpp:47:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/message_buffer/message.hpp:32:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/frame.hpp:35:
/Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/common/network.hpp:74:17: error: expected ')'
inline uint64_t ntohll(uint64_t src) {
                ^
/usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
#define ntohll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:30: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
                             ^
/Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/common/network.hpp:74:17: note: to match this '('
/usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
#define ntohll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
    ^
In file included from /Users/wILL/Documents/casablanca/Release/tests/functional/websockets/utilities/test_websocket_server.cpp:55:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/config/asio_no_tls.hpp:31:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/config/core.hpp:47:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/message_buffer/message.hpp:32:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/frame.hpp:35:
/Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/common/network.hpp:74:17: error: redefinition of '__builtin_constant_p'
inline uint64_t ntohll(uint64_t src) {
                ^
/usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
#define ntohll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:6: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
     ^
/Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/common/network.hpp:53:17: note: previous definition is here
inline uint64_t htonll(uint64_t src) {
                ^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:6: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
     ^
In file included from /Users/wILL/Documents/casablanca/Release/tests/functional/websockets/utilities/test_websocket_server.cpp:55:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/config/asio_no_tls.hpp:31:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/config/core.hpp:47:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/message_buffer/message.hpp:32:
/Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/frame.hpp:270:30: error: unexpected parenthesis after '::'
        temp64.i = lib::net::htonll(payload_size);
                             ^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
    ^
In file included from /Users/wILL/Documents/casablanca/Release/tests/functional/websockets/utilities/test_websocket_server.cpp:55:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/config/asio_no_tls.hpp:31:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/config/core.hpp:47:
In file included from /Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/message_buffer/message.hpp:32:
/Users/wILL/Documents/casablanca/Release/libs/websocketpp/websocketpp/frame.hpp:588:22: error: unexpected parenthesis after '::'
    return lib::net::ntohll(temp64.i);
                     ^
/usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
#define ntohll(x)       __DARWIN_OSSwapInt64(x)
                        ^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
    ^
5 errors generated.
make[2]: *** [tests/functional/websockets/utilities/CMakeFiles/websockettest_utilities.dir/test_websocket_server.cpp.o] Error 1
make[1]: *** [tests/functional/websockets/utilities/CMakeFiles/websockettest_utilities.dir/all] Error 2
make: *** [all] Error 2
Thanks,

wILL
Coordinator
Oct 28, 2014 at 11:40 PM
Edited Oct 28, 2014 at 11:55 PM
Hi Will,

It looks like all these errors are caused by our tests. The core product code should still be built correctly though.

It should be fixed soon, but in the meantime you can work around this by specifying -DBUILD_TESTS=OFF on the cmake commandline.

EDIT: Since this appears to only affect iOS, I assume you've found it by invoking cmake directly on the subdirectories we use for the architecture-specific builds. In this case, you will need to execute something like cmake --build . --target cpprest to avoid building the tests.

Sincerely,
roschuma
Oct 29, 2014 at 12:32 PM
Edited Oct 29, 2014 at 2:07 PM
Hey!

Thanks for the quick answer, i was able to builit successfully with tests disabled on the development branch.
I'd like to make a formula for Homebrew, but without building tests it won't be great.

EDIT: For the Homebrew formula, please see this
https://github.com/Homebrew/homebrew/issues/33689

Btw, do you consider adding a tarball download link for the next releases?

Wiliam
Coordinator
Oct 29, 2014 at 6:08 PM
Hi Will,

FYI - I've checked in fix in the development branch the tests for iOS are building successfully. They tests also now build by default when targeting iOS.

Steve
Oct 29, 2014 at 6:25 PM
Edited Oct 29, 2014 at 6:28 PM
Hi stevetgates,

I'm sorry but i can assure both of you i was following the build instructions for OSX, so i don't really understand how we came to speak about iOS. Is there any direct relation?

Anyway, when i tried again after you today's pushs (https://casablanca.codeplex.com/SourceControl/list/changesets), i was able to build the development branch on OSX.

All the tests run well except three:
/Users/wILL/Documents/casablanca/Release/tests/functional/http/client/outside_tests.cpp:56: error: Failure in outside_cnn_dot_com: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
/Users/wILL/Documents/casablanca/Release/tests/functional/http/client/outside_tests.cpp:67: error: Failure in outside_cnn_dot_com: CHECK_EQUAL(status_codes::MovedPermanently, response.status_code()) where status_codes::MovedPermanently=301 and response.status_code()=302
 FAILED
Test case outside_tests:outside_cnn_dot_com FAILED
Starting test case outside_tests:outside_google_dot_com...
/Users/wILL/Documents/casablanca/Release/tests/functional/http/client/outside_tests.cpp:77: error: Failure in outside_google_dot_com: CHECK_EQUAL(status_codes::OK, response.status_code()) where status_codes::OK=200 and response.status_code()=302
 FAILED
Test case outside_tests:outside_google_dot_com FAILED
Starting test case outside_tests:reading_google_stream...
/Users/wILL/Documents/casablanca/Release/tests/functional/http/client/outside_tests.cpp:104: error: Failure in reading_google_stream: CHECK_EQUAL(strcmp((const char *)chars, "<!doctype html><html itemscope=\"\" itemtype=\"http://schema.org/WebPage\""), 0) where strcmp((const char *)chars, "<!doctype html><html itemscope=\"\" itemtype=\"http://schema.org/WebPage\"")=39 and 0=0
 FAILED
Test case outside_tests:reading_google_stream FAILED
I launched them following the doc:
cd Binaries
./test_runner *_test.dylib
About Homebrew, i realized it is maybe not the best topic to speak about it. Could you lead me to the person(s) who i should talk to about this subject?

Regards,

William
Coordinator
Oct 29, 2014 at 6:30 PM
Hi William,

My mistake I immediately jumped to iOS. To my understanding we are all set now for OSX and iOS. The 3 tests you are seeing fail depend on outside live sites so can depend on your network, so I wouldn't worry much about those failures.

Thanks for reporting,
Steve
Coordinator
Oct 29, 2014 at 8:26 PM
HI William,

For building a package in homebrew: Great! We'd like to help you with this (especially considering issues like these).
  • We won't be providing a downloadable tarball for each release in the near future. Will a simple git clone && git checkout` not suffice?
  • These failures are unfortunately caused by the last OSX update (they changed what used to be a simple function into a macro which breaks our dependencies). This is why master is also broken :(
  • If there's anything else you need help with, let us know.
Sincerely,
roschuma
Oct 29, 2014 at 9:26 PM
Could we continue the discussion about Homebrew on this new thread please:
https://casablanca.codeplex.com/discussions/570861

Thanks