Skip to content
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

Error building in macOS #768

Closed
yjaek opened this issue May 23, 2018 · 3 comments
Closed

Error building in macOS #768

yjaek opened this issue May 23, 2018 · 3 comments

Comments

@yjaek
Copy link

yjaek commented May 23, 2018

I am using macOS High Sierra Version 10.13.3, and I receive the following error.

Yongs-MacBook-Pro:~ yongjae$ cd casablanca/
Yongs-MacBook-Pro:casablanca yongjae$ mkdir build.release
Yongs-MacBook-Pro:casablanca yongjae$ cd build.release/
Yongs-MacBook-Pro:build.release yongjae$ cmake ../Release -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Looking for include file xlocale.h
-- Looking for include file xlocale.h - found
-- Setting clang options
-- websocketpp not found, using the embedded version
-- Boost version: 1.67.0
-- Found the following Boost libraries:
-- random
-- system
-- thread
-- filesystem
-- chrono
-- atomic
-- date_time
-- regex
-- Found OpenSSL: /usr/local/lib/libcrypto.dylib (found suitable version "1.1.1", minimum required is "1.0.0")
-- Performing Test _SSL_LEAK_SUPPRESS_AVAILABLE
-- Performing Test _SSL_LEAK_SUPPRESS_AVAILABLE - Failed
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11")
-- Added test library httpclient_test
-- Added test library httplistener_test
-- Added test library json_test
-- Added test library pplx_test
-- Added test library streams_test
-- Added test library uri_test
-- Added test library utils_test
-- Added test library websocketsclient_test
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/yongjae/casablanca/build.release
Yongs-MacBook-Pro:build.release yongjae$ make -j 4
Scanning dependencies of target cpprest
[ 1%] Building CXX object src/CMakeFiles/cpprest.dir/http/client/http_client.cpp.o
[ 1%] Building CXX object src/CMakeFiles/cpprest.dir/http/client/http_client_msg.cpp.o
[ 2%] Building CXX object src/CMakeFiles/cpprest.dir/http/client/x509_cert_utilities.cpp.o
[ 2%] Building CXX object src/CMakeFiles/cpprest.dir/http/common/http_helpers.cpp.o
[ 3%] Building CXX object src/CMakeFiles/cpprest.dir/http/common/http_msg.cpp.o
[ 3%] Building CXX object src/CMakeFiles/cpprest.dir/http/listener/http_listener.cpp.o
[ 4%] Building CXX object src/CMakeFiles/cpprest.dir/http/listener/http_listener_msg.cpp.o
[ 4%] Building CXX object src/CMakeFiles/cpprest.dir/http/listener/http_server_api.cpp.o
[ 5%] Building CXX object src/CMakeFiles/cpprest.dir/http/oauth/oauth1.cpp.o
[ 6%] Building CXX object src/CMakeFiles/cpprest.dir/http/oauth/oauth2.cpp.o
[ 6%] Building CXX object src/CMakeFiles/cpprest.dir/json/json.cpp.o
[ 7%] Building CXX object src/CMakeFiles/cpprest.dir/json/json_parsing.cpp.o
[ 7%] Building CXX object src/CMakeFiles/cpprest.dir/json/json_serialization.cpp.o
[ 8%] Building CXX object src/CMakeFiles/cpprest.dir/pplx/pplx.cpp.o
[ 9%] Building CXX object src/CMakeFiles/cpprest.dir/uri/uri.cpp.o
[ 9%] Building CXX object src/CMakeFiles/cpprest.dir/uri/uri_builder.cpp.o
[ 10%] Building CXX object src/CMakeFiles/cpprest.dir/utilities/asyncrt_utils.cpp.o
[ 10%] Building CXX object src/CMakeFiles/cpprest.dir/utilities/base64.cpp.o
[ 11%] Building CXX object src/CMakeFiles/cpprest.dir/utilities/web_utilities.cpp.o
[ 12%] Building CXX object src/CMakeFiles/cpprest.dir/websockets/client/ws_msg.cpp.o
[ 12%] Building CXX object src/CMakeFiles/cpprest.dir/websockets/client/ws_client.cpp.o
[ 13%] Building CXX object src/CMakeFiles/cpprest.dir/websockets/client/ws_client_wspp.cpp.o
[ 13%] Building CXX object src/CMakeFiles/cpprest.dir/pplx/pplxapple.cpp.o
[ 14%] Building CXX object src/CMakeFiles/cpprest.dir/pplx/threadpool.cpp.o
[ 15%] Building CXX object src/CMakeFiles/cpprest.dir/http/client/http_client_asio.cpp.o
[ 15%] Building CXX object src/CMakeFiles/cpprest.dir/streams/fileio_posix.cpp.o
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:654:76: error: lambda capture 'this' is not
used [-Werror,-Wunused-lambda-capture]
auto start_http_request_flow = [proxy_type, proxy_host, proxy_port AND_CAPTURE_MEMBER_FUNCTION_POINTER...
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:59:48: note: expanded from macro
'AND_CAPTURE_MEMBER_FUNCTION_POINTERS'
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:1044:120: error: lambda capture 'this' is not
used [-Werror,-Wunused-lambda-capture]
...+ http::details::chunked_encoding::data_offset, chunkSize).then([this_request, buf, chunkSize AND_CAPTURE_MEMB...
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:59:48: note: expanded from macro
'AND_CAPTURE_MEMBER_FUNCTION_POINTERS'
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:1101:118: error: lambda capture 'this' is not
used [-Werror,-Wunused-lambda-capture]
...*>(m_body_buf.prepare(readSize)), readSize).then([this_request AND_CAPTURE_MEMBER_FUNCTION_POINTERS](pplx::tas...
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:59:48: note: expanded from macro
'AND_CAPTURE_MEMBER_FUNCTION_POINTERS'
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:1404:79: error: lambda capture 'this' is not
used [-Werror,-Wunused-lambda-capture]
.then([this_request, to_read, shared_decompressed AND_CAPTURE_MEMBER_FUNCTION_POIN...
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:59:48: note: expanded from macro
'AND_CAPTURE_MEMBER_FUNCTION_POINTERS'
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:1422:144: error: lambda capture 'this' is not
used [-Werror,-Wunused-lambda-capture]
...uint8_t *>(m_body_buf.data()), to_read).then([this_request, to_read AND_CAPTURE_MEMBER_FUNCTION_POINTERS](pplx...
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:59:48: note: expanded from macro
'AND_CAPTURE_MEMBER_FUNCTION_POINTERS'
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:1519:77: error: lambda capture 'this' is not
used [-Werror,-Wunused-lambda-capture]
.then([this_request, read_size, shared_decompressed AND_CAPTURE_MEMBER_FUNCTION_POINTE...
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:59:48: note: expanded from macro
'AND_CAPTURE_MEMBER_FUNCTION_POINTERS'
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:1541:37: error: lambda capture 'this' is not
used [-Werror,-Wunused-lambda-capture]
.then([this_request AND_CAPTURE_MEMBER_FUNCTION_POINTERS](pplx::task<size_t> op)
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:59:48: note: expanded from macro
'AND_CAPTURE_MEMBER_FUNCTION_POINTERS'
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:1592:37: error: lambda capture 'this' is not
used [-Werror,-Wunused-lambda-capture]
m_timer.async_wait([ctx AND_CAPTURE_MEMBER_FUNCTION_POINTERS](const boost::system::error_code& ec)
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:59:48: note: expanded from macro
'AND_CAPTURE_MEMBER_FUNCTION_POINTERS'
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:1607:41: error: lambda capture 'this' is not
used [-Werror,-Wunused-lambda-capture]
m_timer.async_wait([ctx AND_CAPTURE_MEMBER_FUNCTION_POINTERS](const boost::system::error_code& ec)
^
/Users/yongjae/casablanca/Release/src/http/client/http_client_asio.cpp:59:48: note: expanded from macro
'AND_CAPTURE_MEMBER_FUNCTION_POINTERS'
#define AND_CAPTURE_MEMBER_FUNCTION_POINTERS , this
^
[ 16%] Building CXX object src/CMakeFiles/cpprest.dir/http/listener/http_server_asio.cpp.o
9 errors generated.
make[2]: *** [src/CMakeFiles/cpprest.dir/http/client/http_client_asio.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/CMakeFiles/cpprest.dir/all] Error 2
make: *** [all] Error 2

Would someone help me resolve this issue?

@allfii
Copy link

allfii commented May 23, 2018

I got exactly the same issue with you on OS X. I think those error messages "'this' is not used" should not be an error but actually just a warning. I think this may be safely ignored by doing work around with -DWERROR=OFF and passing it to the cmake configure as additional argument.

@garethsb
Copy link
Contributor

AND_CAPTURE_MEMBER_FUNCTION_POINTERS is a workaround for some compilers. It looks like it's being used unnecessarily in your environment and thus generating a warning. If you set WERROR to 0 when calling CMake at least that warning won't be treated as an error.

@yjaek
Copy link
Author

yjaek commented May 23, 2018

Thank you, @masphei and @garethsb-sony. My issue is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants