{"action":"created","issue":{"url":"https://api.github.com/repos/davisking/dlib/issues/378","repository_url":"https://api.github.com/repos/davisking/dlib","labels_url":"https://api.github.com/repos/davisking/dlib/issues/378/labels{/name}","comments_url":"https://api.github.com/repos/davisking/dlib/issues/378/comments","events_url":"https://api.github.com/repos/davisking/dlib/issues/378/events","html_url":"https://github.com/davisking/dlib/issues/378","id":197704523,"number":378,"title":"Including dlib in android ndk","user":{"login":"johnygeorge","id":12555816,"avatar_url":"https://avatars.githubusercontent.com/u/12555816?v=3","gravatar_id":"","url":"https://api.github.com/users/johnygeorge","html_url":"https://github.com/johnygeorge","followers_url":"https://api.github.com/users/johnygeorge/followers","following_url":"https://api.github.com/users/johnygeorge/following{/other_user}","gists_url":"https://api.github.com/users/johnygeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/johnygeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnygeorge/subscriptions","organizations_url":"https://api.github.com/users/johnygeorge/orgs","repos_url":"https://api.github.com/users/johnygeorge/repos","events_url":"https://api.github.com/users/johnygeorge/events{/privacy}","received_events_url":"https://api.github.com/users/johnygeorge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-27T13:39:21Z","updated_at":"2016-12-27T14:35:37Z","closed_at":null,"body":"I am trying to create an `android ndk` project which combines `dlib` and `opencv`. The error is coming from the `dlib` library.\r\n\r\nBut I am getting the following error, when I try to build the program.\r\nWhat is wrong ?\r\n\r\n    FAILURE: Build failed with an exception.\r\n    \r\n    * What went wrong:\r\n    Execution failed for task ':mobile:externalNativeBuildDebug'.\r\n    > Build command failed.\r\n      Error while executing '/opt/android-sdk-linux/cmake/3.6.3155560/bin/cmake' with arguments {--build mobile/.externalNativeBuild/cmake/debug/arm64-v8a --target native-lib}\r\n      [1/4] Building CXX object CMakeFiles/lib_dlib.dir/src/main/cpp/source.cpp.o\r\n      FAILED: /opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++  -target aarch64-none-linux-android -gcc-toolchain /opt/android-sdk-linux/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 --sysroot=/opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64  -Dlib_dlib_EXPORTS -I/usr/local/include -I/usr/local/include/dlib -isystem /opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -isystem /opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -std=c++11 -frtti -fexceptions -v -Wall -Werror -Wno-unused-variable -w -std=gnu++11 -O0 -fno-limit-debug-info -O0 -fno-limit-debug-info  -fPIC -MD -MT CMakeFiles/lib_dlib.dir/src/main/cpp/source.cpp.o -MF CMakeFiles/lib_dlib.dir/src/main/cpp/source.cpp.o.d -o CMakeFiles/lib_dlib.dir/src/main/cpp/source.cpp.o -c mobile/src/main/cpp/source.cpp\r\n      Android clang version 3.8.256229  (based on LLVM 3.8.256229)\r\n      Target: aarch64-none-linux-android\r\n      Thread model: posix\r\n      InstalledDir: /opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin\r\n      Found candidate GCC installation: /opt/android-sdk-linux/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x\r\n      Selected GCC installation: /opt/android-sdk-linux/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x\r\n      Candidate multilib: .;@m64\r\n      Selected multilib: .;@m64\r\n       \"/opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++\" -cc1 -triple aarch64-none-linux-android -emit-obj -mrelax-all -mnoexecstack -mnoexecstack -disable-free -disable-llvm-verifier -main-file-name source.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu generic -target-feature +neon -target-abi aapcs -backend-option -aarch64-fix-cortex-a53-835769=1 -target-linker-version 2.24 -v -dwarf-column-info -debug-info-kind=standalone -dwarf-version=4 -debugger-tuning=gdb -ffunction-sections -coverage-file mobile/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/lib_dlib.dir/src/main/cpp/source.cpp.o -resource-dir /opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib64/clang/3.8.256229 -dependency-file CMakeFiles/lib_dlib.dir/src/main/cpp/source.cpp.o.d -sys-header-deps -MT CMakeFiles/lib_dlib.dir/src/main/cpp/source.cpp.o -isystem /opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -isystem /opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -D lib_dlib_EXPORTS -I /usr/local/include -I /usr/local/include/dlib -D ANDROID -D ANDROID -isysroot /opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64 -internal-isystem /opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/usr/local/include -internal-isystem /opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib64/clang/3.8.256229/include -internal-externc-isystem /opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/include -internal-externc-isystem /opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/usr/include -O0 -Wformat -Werror=format-security -Wformat -Werror=format-security -Wall -Werror -Wno-unused-variable -w -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir mobile/.externalNativeBuild/cmake/debug/arm64-v8a -ferror-limit 19 -fmessage-length 0 -femulated-tls -stack-protector 2 -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o CMakeFiles/lib_dlib.dir/src/main/cpp/source.cpp.o -x c++ /mobile/src/main/cpp/source.cpp\r\n      clang -cc1 version 3.8.256229 based upon LLVM 3.8.256229 default target x86_64-unknown-linux\r\n      ignoring nonexistent directory \"/opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/usr/local/include\"\r\n      ignoring nonexistent directory \"/opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/include\"\r\n      #include \"...\" search starts here:\r\n      #include <...> search starts here:\r\n       /usr/local/include\r\n       /usr/local/include/dlib\r\n       /opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include\r\n       /opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include\r\n       /opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward\r\n       /opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib64/clang/3.8.256229/include\r\n       /opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/usr/include\r\n      End of search list.\r\n      In file included from mobile/src/main/cpp/source.cpp:22:\r\n      In file included from /usr/local/include/dlib/dlib/data_io/image_dataset_metadata.cpp:6:\r\n      In file included from /usr/local/include/dlib/dlib/data_io/image_dataset_metadata.h:8:\r\n      In file included from /usr/local/include/dlib/dlib/base64/../geometry/../image_processing/../geometry.h:10:\r\n      In file included from /usr/local/include/dlib/dlib/base64/../geometry/point_transforms.h:9:\r\n      In file included from /usr/local/include/dlib/dlib/base64/../statistics/../matrix.h:7:\r\n      /usr/local/include/dlib/dlib/base64/../geometry/../matrix/matrix_utilities.h:2665:29: error: static_assert expression is not an integral constant expression\r\n              COMPILE_TIME_ASSERT(pixel_traits<P>::num > 0);\r\n                                  ^~~~~~~~~~~~~~~~~~~~~~~~\r\n      /usr/local/include/dlib/dlib/base64/../gui_core/../assert.h:93:59: note: expanded from macro 'COMPILE_TIME_ASSERT'\r\n          #define COMPILE_TIME_ASSERT(expression) static_assert(expression, \"Failed assertion\")\r\n                                                                ^~~~~~~~~~\r\n      /usr/local/include/dlib/dlib/base64/../gui_widgets/canvas_drawing.h:945:23: note: in instantiation of function template specialization 'dlib::pixel_to_vector<long, dlib::rgb_pixel>' requested here\r\n                          ((pixel_to_vector<long>(pixel_top)*t + \r\n                            ^\r\n      /usr/local/include/dlib/dlib/base64/../gui_widgets/style.h:633:21: note: in instantiation of function template specialization 'dlib::fill_rect_with_vertical_gradient<dlib::rgb_pixel>' requested here\r\n                          fill_rect_with_vertical_gradient(c,rect,rgb_pixel(110,160,255),  rgb_pixel(100,130,250),display_rect);\r\n                          ^\r\n      /usr/local/include/dlib/dlib/base64/../gui_widgets/style.h:597:19: note: in instantiation of function template specialization 'dlib::list_box_style_default::draw_list_box_item_template<std::basic_string<char> >' requested here\r\n              ) const { draw_list_box_item_template(c,rect,display_rect, enabled, mfont, text, is_selected); }\r\n                        ^\r\n      /usr/local/include/dlib/dlib/base64/../geometry/../matrix/matrix_utilities.h:2665:50: note: non-constexpr function 'operator><dlib::pixel_traits<dlib::rgb_pixel>::(anonymous enum at /usr/local/include/dlib/dlib/base64/../gui_widgets/../image_transforms/../pixel.h:414:9), int>' cannot be used in a constant expression\r\n              COMPILE_TIME_ASSERT(pixel_traits<P>::num > 0);\r\n                                                       ^\r\n      /usr/local/include/dlib/dlib/base64/../sync_extension/../algs.h:286:14: note: declared here\r\n              bool operator> (\r\n                   ^\r\n      In file included from mobile/src/main/cpp/source.cpp:22:\r\n      In file included from /usr/local/include/dlib/dlib/data_io/image_dataset_metadata.cpp:6:\r\n      In file included from /usr/local/include/dlib/dlib/data_io/image_dataset_metadata.h:8:\r\n      In file included from /usr/local/include/dlib/dlib/base64/../geometry/../image_processing/../geometry.h:10:\r\n      In file included from /usr/local/include/dlib/dlib/base64/../geometry/point_transforms.h:9:\r\n      In file included from /usr/local/include/dlib/dlib/base64/../statistics/../matrix.h:7:\r\n      /usr/local/include/dlib/dlib/base64/../geometry/../matrix/matrix_utilities.h:2665:29: error: static_assert expression is not an integral constant expression\r\n              COMPILE_TIME_ASSERT(pixel_traits<P>::num > 0);\r\n                                  ^~~~~~~~~~~~~~~~~~~~~~~~\r\n      /usr/local/include/dlib/dlib/base64/../gui_core/../assert.h:93:59: note: expanded from macro 'COMPILE_TIME_ASSERT'\r\n          #define COMPILE_TIME_ASSERT(expression) static_assert(expression, \"Failed assertion\")\r\n                                                                ^~~~~~~~~~\r\n      /usr/local/include/dlib/dlib/base64/../gui_widgets/canvas_drawing.h:945:23: note: in instantiation of function template specialization 'dlib::pixel_to_vector<long, dlib::rgb_alpha_pixel>' requested here\r\n                          ((pixel_to_vector<long>(pixel_top)*t + \r\n                            ^\r\n      /usr/local/include/dlib/dlib/base64/../gui_widgets/base_widgets.h:1570:17: note: in instantiation of function template specialization 'dlib::fill_rect_with_vertical_gradient<dlib::rgb_alpha_pixel>' requested here\r\n                      fill_rect_with_vertical_gradient(c, rect,rgb_alpha_pixel(0,200,0,100), rgb_alpha_pixel(0,0,0,100));\r\n                      ^\r\n      /usr/local/include/dlib/dlib/base64/../geometry/../matrix/matrix_utilities.h:2665:50: note: non-constexpr function 'operator><dlib::pixel_traits<dlib::rgb_alpha_pixel>::(anonymous enum at /usr/local/include/dlib/dlib/base64/../gui_widgets/../image_transforms/../pixel.h:450:9), int>' cannot be used in a constant expression\r\n              COMPILE_TIME_ASSERT(pixel_traits<P>::num > 0);\r\n                                                       ^\r\n      /usr/local/include/dlib/dlib/base64/../sync_extension/../algs.h:286:14: note: declared here\r\n              bool operator> (\r\n                   ^\r\n      In file included from mobile/src/main/cpp/source.cpp:22:\r\n      In file included from /usr/local/include/dlib/dlib/data_io/image_dataset_metadata.cpp:6:\r\n      In file included from /usr/local/include/dlib/dlib/data_io/image_dataset_metadata.h:8:\r\n      In file included from /usr/local/include/dlib/dlib/base64/../geometry/../image_processing/../geometry.h:10:\r\n      In file included from /usr/local/include/dlib/dlib/base64/../geometry/point_transforms.h:9:\r\n      In file included from /usr/local/include/dlib/dlib/base64/../statistics/../matrix.h:7:\r\n      /usr/local/include/dlib/dlib/base64/../geometry/../matrix/matrix_utilities.h:2665:29: error: static_assert expression is not an integral constant expression\r\n              COMPILE_TIME_ASSERT(pixel_traits<P>::num > 0);\r\n                                  ^~~~~~~~~~~~~~~~~~~~~~~~\r\n      /usr/local/include/dlib/dlib/base64/../gui_core/../assert.h:93:59: note: expanded from macro 'COMPILE_TIME_ASSERT'\r\n          #define COMPILE_TIME_ASSERT(expression) static_assert(expression, \"Failed assertion\")\r\n                                                                ^~~~~~~~~~\r\n      /usr/local/include/dlib/dlib/base64/../gui_widgets/canvas_drawing.h:836:31: note: in instantiation of function template specialization 'dlib::pixel_to_vector<unsigned long, dlib::rgb_alpha_pixel>' requested here\r\n                                  ((pixel_to_vector<unsigned long>(top_color)*c_t + pixel_to_vector<unsigned long>(bottom_color)*c_s)/c_div));\r\n                                    ^\r\n      /usr/local/include/dlib/dlib/gui_widgets/style.cpp:146:13: note: in instantiation of function template specialization 'dlib::fill_gradient_rounded<dlib::rgb_alpha_pixel>' requested here\r\n                  fill_gradient_rounded(c,rect,radius,rgb_alpha_pixel(255, 255, 255,120-d), \r\n                  ^\r\n      /usr/local/include/dlib/dlib/base64/../geometry/../matrix/matrix_utilities.h:2665:50: note: non-constexpr function 'operator><dlib::pixel_traits<dlib::rgb_alpha_pixel>::(anonymous enum at /usr/local/include/dlib/dlib/base64/../gui_widgets/../image_transforms/../pixel.h:450:9), int>' cannot be used in a constant expression\r\n              COMPILE_TIME_ASSERT(pixel_traits<P>::num > 0);\r\n                                                       ^\r\n      /usr/local/include/dlib/dlib/base64/../sync_extension/../algs.h:286:14: note: declared here\r\n              bool operator> (\r\n                   ^\r\n      3 errors generated.\r\n      ninja: build stopped: subcommand failed.\r\n    \r\n    \r\n    * Try:\r\n    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/davisking/dlib/issues/comments/269333727","html_url":"https://github.com/davisking/dlib/issues/378#issuecomment-269333727","issue_url":"https://api.github.com/repos/davisking/dlib/issues/378","id":269333727,"user":{"login":"davisking","id":6259399,"avatar_url":"https://avatars.githubusercontent.com/u/6259399?v=3","gravatar_id":"","url":"https://api.github.com/users/davisking","html_url":"https://github.com/davisking","followers_url":"https://api.github.com/users/davisking/followers","following_url":"https://api.github.com/users/davisking/following{/other_user}","gists_url":"https://api.github.com/users/davisking/gists{/gist_id}","starred_url":"https://api.github.com/users/davisking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davisking/subscriptions","organizations_url":"https://api.github.com/users/davisking/orgs","repos_url":"https://api.github.com/users/davisking/repos","events_url":"https://api.github.com/users/davisking/events{/privacy}","received_events_url":"https://api.github.com/users/davisking/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T14:35:37Z","updated_at":"2016-12-27T14:35:37Z","body":"Yeah, that's annoying. I just pushed a change to github that should fix\nit.  So try the latest code.\n"}}
{"actor":{"display_login":"davisking"}}