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)
임현재 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.