How should i build with boost in flutter plugin?

OS : Windows-10
Tool : Android-Studio Koala | 2024.1.1

type here

https://codelabs.developers.google.com/codelabs/flutter-ffigen?hl=ko#2

I’m trying to build an app like the above.

flutter create –template=plugin_ffi
–platforms=android,ios,linux,macos,windows ffigen_app

Okay.. it’s good.

I added the boost which is installed vcpkg.

in src folder.
add CmakePresets.json file as below

{
    "version": 8,
    "configurePresets": [
        {
            "name": "GCC 6.3.0 mingw32",
            "displayName": "GCC 6.3.0 mingw32",
            "description": "Using compilers: C = C:\MinGW\bin\gcc.exe, CXX = C:\MinGW\bin\g++.exe",
            "binaryDir": "${sourceDir}/out/build/${presetName}",
            "cacheVariables": {
                "CMAKE_TOOLCHAIN_FILE": "c:/vcpkg/scripts/buildsystems/vcpkg.cmake",
                "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
                "CMAKE_C_COMPILER": "C:/MinGW/bin/gcc.exe",
                "CMAKE_CXX_COMPILER": "C:/MinGW/bin/g++.exe",
                "CMAKE_BUILD_TYPE": "Debug"
            }
        }
    ]
}

and modify CMakeLists.txt

cmake_minimum_required(VERSION 3.10)

project(ffi_gen_library VERSION 0.0.1 LANGUAGES C)

find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})

add_library(native_tcp SHARED
  "ffi_gen.c"
)

set_target_properties(native_tcp PROPERTIES
  PUBLIC_HEADER ffi_gen.h
  OUTPUT_NAME "ffi_gen"
)

target_compile_definitions(ffi_gen PUBLIC DART_SHARED_LIB)

I work only added CMakePresets.json file and modify find_package() and include_directories() in CMakefiles.txt

I hope to build with boost included

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':native_tcp:configureCMakeDebug[arm64-v8a]'.
> [CXX1405] error when building with cmake using G:native_tcpsrcCMakeLists.txt: -- Configuring incomplete, errors occurred!
  See also "G:/native_tcp/android/.cxx/Debug/4r172ix6/arm64-v8a/CMakeFiles/CMakeOutput.log".

  C++ build system [configure] failed while executing:
      @echo off
      "C:\Users\imhj\AppData\Local\Android\sdk\cmake\3.18.1\bin\cmake.exe" ^
        "-HG:\native_tcp\src" ^
        "-DCMAKE_SYSTEM_NAME=Android" ^
        "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^
        "-DCMAKE_SYSTEM_VERSION=21" ^
        "-DANDROID_PLATFORM=android-21" ^
        "-DANDROID_ABI=arm64-v8a" ^
        "-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" ^
        "-DANDROID_NDK=C:\Users\imhj\AppData\Local\Android\sdk\ndk\23.1.7779620" ^
        "-DCMAKE_ANDROID_NDK=C:\Users\imhj\AppData\Local\Android\sdk\ndk\23.1.7779620" ^
        "-DCMAKE_TOOLCHAIN_FILE=C:\Users\imhj\AppData\Local\Android\sdk\ndk\23.1.7779620\build\cmake\android.toolchain.cmake" ^
        "-DCMAKE_MAKE_PROGRAM=C:\Users\imhj\AppData\Local\Android\sdk\cmake\3.18.1\bin\ninja.exe" ^
        "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=G:\native_tcp\example\build\native_tcp\intermediates\cxx\Debug\4r172ix6\obj\arm64-v8a" ^
        "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=G:\native_tcp\example\build\native_tcp\intermediates\cxx\Debug\4r172ix6\obj\arm64-v8a" ^
        "-DCMAKE_BUILD_TYPE=Debug" ^
        "-BG:\native_tcp\android\.cxx\Debug\4r172ix6\arm64-v8a" ^
        -GNinja
    from G:native_tcpandroid
  CMake Warning at C:/Users/imhj/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android-legacy.toolchain.cmake:416 (message):
    An old version of CMake is being used that cannot automatically detect
    compiler attributes.  Compiler identification is being bypassed.  Some
    values may be wrong or missing.  Update to CMake 3.19 or newer to use
    CMake's built-in compiler identification.
  Call Stack (most recent call first):
    C:/Users/imhj/AppData/Local/Android/Sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake:55 (include)
    G:/native_tcp/android/.cxx/Debug/4r172ix6/arm64-v8a/CMakeFiles/3.18.1-g262b901-dirty/CMakeSystem.cmake:6 (include)
    CMakeLists.txt:6 (project)


  CMake Error at C:/Users/imhj/AppData/Local/Android/Sdk/cmake/3.18.1/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
    Could NOT find Boost (missing: Boost_INCLUDE_DIR)
  Call Stack (most recent call first):
    C:/Users/imhj/AppData/Local/Android/Sdk/cmake/3.18.1/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
    C:/Users/imhj/AppData/Local/Android/Sdk/cmake/3.18.1/share/cmake-3.18/Modules/FindBoost.cmake:2177 (find_package_handle_standard_args)
    CMakeLists.txt:11 (find_package)

I saw the letter “boost not found” at the bottom of the error message.
Could NOT find Boost (missing: Boost_INCLUDE_DIR)

New contributor

임현재 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật