title: error when building with cmake using C:\project\libresample_flutter\android\CMakeLists.txt: Build command failed
body: <p>I use package ffi in flutter but when building with cmake: error exception ,Whatever I searched for, I did not find how to fix this error</p>
  <p>Execution failed for task ':libresample_flutter:configureCMakeDebug[arm64-v8a]'.</p>
  <blockquote>
  <p>[CXX1405] error when building with cmake using C:\project\libresample_flutter\android\CMakeLists.txt: Build command failed</p>
  </blockquote>
  <pre><code>
      cmake_minimum_required(VERSION 3.4.1)
      
      add_library( native_libresample
      
                   SHARED
      
                   ../ios/Classes/filterkit.c ../ios/Classes/lrsexport.c ../ios/Classes/resample.c ../ios/Classes/resamplesubs.c )```
      
      and gradle:
      ```group 'io.swhh.libresample_flutter'
      version '1.0'
      
      buildscript {
          repositories {
              google()
              jcenter()
          }
      
          dependencies {
              classpath 'com.android.tools.build:gradle:3.5.0'
          }
      }
      
      rootProject.allprojects {
          repositories {
              google()
              jcenter()
          }
      }
      
      apply plugin: 'com.android.library'
      
      android {
          compileSdkVersion 31
      
          defaultConfig {
              minSdkVersion 16
              testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
          }
          lintOptions {
              disable 'InvalidPackage'
          }
        externalNativeBuild {
          // Encapsulates your CMake build configurations.
          cmake {
            // Provides a relative path to your CMake build script.
            path &quot;CMakeLists.txt&quot;
          }
        }
      }
  
  </code></pre>
  <p>and flutter.dart</p>
  <pre><code>
      import 'dart:ffi';
      import 'dart:io';
      import 'dart:math';
      import 'dart:typed_data';
      
      
      /*
      'C' Header definition
      void* lrs_open(WORD highQuality,
                     double minFactor,
                     double maxFactor) {
       */
      typedef lrs_open_func = Pointer&lt;Void&gt; Function(Int32, Double, Double);
      typedef LrsOpen = Pointer&lt;Void&gt; Function(int, double, double);
      
      /*
      'C' Header definition
      void lrs_close(void *handle) {
       */
      typedef lrs_close_func = Void Function(Pointer&lt;Void&gt;);
      typedef LrsClose = void Function(Pointer&lt;Void&gt;);
      
      /*
      'C' Header definition
      WORD lrs_process(void *handle,
                      double factor,
                      float *inBuffer,
                      WORD inBufferLen,
                      WORD lastFlag,
                      WORD *inBufferUsed,
                      float *outBuffer,
                      WORD outBufferLen) {
       */
      typedef lrs_process_func = Int32 Function(
        Pointer&lt;Void&gt;,
        Double,
        Pointer&lt;Float&gt;,
        Int32,
        Int32,
        Pointer&lt;Int32&gt;,
        Pointer&lt;Float&gt;,
        Int32,
      );
      typedef LrsProcess = int Function(
        Pointer&lt;Void&gt;,
        double,
        Pointer&lt;Float&gt;,
        int,
        int,
        Pointer&lt;Int32&gt;,
        Pointer&lt;Float&gt;,
        int,
      );
      
   
      class LibresampleFlutter {
        static LibresampleFlutter? _instance;
      
        LrsOpen? _lrsOpen;
        LrsClose? _lrsClose;
        LrsProcess? _lrsProcess;
      
        factory LibresampleFlutter() {
          if (_instance == null) {
            _instance = LibresampleFlutter._();
          }
          return _instance!;
        }
      
        LibresampleFlutter._() {
          final DynamicLibrary nativeLrsLib = Platform.isAndroid
              ? DynamicLibrary.open(&quot;libnative_libresample.so&quot;)
              : DynamicLibrary.process();
      
          _lrsOpen = nativeLrsLib
              .lookup&lt;NativeFunction&lt;lrs_open_func&gt;&gt;('lrs_open')
              .asFunction();
      
          _lrsClose = nativeLrsLib
              .lookup&lt;NativeFunction&lt;lrs_close_func&gt;&gt;('lrs_close')
              .asFunction();
      
          _lrsProcess = nativeLrsLib
              .lookup&lt;NativeFunction&lt;lrs_process_func&gt;&gt;('lrs_process')
              .asFunction();
        }
      }
      
    
      class Resampler {
        double? _maxFactor;
      
        Pointer&lt;Void&gt;? _nativeInstance;
        var _closed = false;
      
       Pointer&lt;Int32&gt;? _inUsed = allocate();
      
        Pointer&lt;Float&gt;? _inBuf;
        var _inLen = 0;
      
        Pointer&lt;Float&gt;? _outBuf;
        var _outLen = 0;
      
   
       [process]. If
        /// a fixed refactoring factor is required they may be the same.
        ///
        /// The [highQuality] setting makes the resample create more filters, leading
        /// to better quality output.
        Resampler(bool highQuality, double minFactor, double maxFactor) {
          _maxFactor = maxFactor;
          _nativeInstance = LibresampleFlutter()._lrsOpen!(
            highQuality ? 1 : 0,
            minFactor,
            maxFactor,
          );
        }
      
        void _ensureBuffers(int inSize) {
          // output buffer needs to be factor * input buffer
          var outSize = (inSize * _maxFactor!).ceil();
          // plus some for luck
          outSize += min(100, (outSize * 0.1).ceil());
      
          // if (_inLen == 0) {
          //   _inLen = inSize;
          //   _inBuf = allocate&lt;Float&gt;(count: inSize);
          // } else if (inSize &gt; _inLen) {
          //   free(_inBuf);
          //   _inLen = inSize;
          //   _inBuf = allocate&lt;Float&gt;(count: inSize);
          // }
          //
          // if (_outLen == 0) {
          //   _outLen = outSize;
          //   _outBuf = allocate&lt;Float&gt;(count: outSize);
          // } else if (outSize &gt; _outLen) {
          //   free(_outBuf);
          //   _outLen = outSize;
          //   _outBuf = allocate&lt;Float&gt;(count: outSize);
          // }
        }
      
      
        Float32List? process(double factor, Float32List input, bool last) {
          if (_closed) {
            throw Exception('already closed');
          }
      
         // _ensureBuffers(input.length);
          _inBuf!.asTypedList(_inLen).setRange(0, input.length, input);
      
          var processed = LibresampleFlutter()._lrsProcess!(
            _nativeInstance!,
            factor,
            _inBuf!,
            input.length,
            last ? 1 : 0,
            _inUsed!,
            _outBuf!,
            _outLen,
          );
      
          if (processed &lt;= 0) {
            print('hmmm $processed');
            return null;
          }
      
          var output = Float32List(processed);
          output.setRange(0, processed, _outBuf!.asTypedList(_outLen));
      
          return output;
        }
      
        /// Closes the resampler and frees its native resources.
        void close() {
          if (!_closed) {
            LibresampleFlutter()._lrsClose!(_nativeInstance!);
            _closed = true;
          }
        }
      
        static Pointer&lt;Int32&gt;? allocate() {
          return null;
        }
      }
      
     [inputStream.moveNext()]
      /// until that returns [false] at the end of the audio.
      class ResamplerStream {
        double _factor;
        Resampler? _resampler;
        Iterator&lt;Float32List&gt;? inputStream;
      
        /// Creates a wrapper around a resampler with an [Iterator] as input and an
        /// [Iterable] as output.
        ///
        /// See [Resampler] for an explanation of [_factor] and [highQuality].
        ResamplerStream(this._factor, bool highQuality) {
          _resampler = Resampler(highQuality, _factor, _factor);
        }
      
        /// Sets the input of this audio block to the [Iterator]
        void setInputStream(Iterator&lt;Float32List&gt; stream) {
          inputStream = stream;
        }
      
        /// Retrieves the [Iterable] that can be used by the next block in the chain.
        Iterable&lt;Float32List?&gt; getOutputStream() sync* {
          while (true) {
            if (!inputStream!.moveNext()) break;
            yield _resampler!.process(_factor, inputStream!.current, false);
          }
        }
      }
  
  </code></pre>
  <p>and main.dart</p>
  <pre><code>
      import 'dart:typed_data';
      
      import 'package:flutter/material.dart';
      import 'dart:async';
      
      import 'package:flutter/services.dart';
      import 'package:libresample_flutter/libresample_flutter.dart';
      
      void main() =&gt; runApp(MyApp());
      
      class MyApp extends StatefulWidget {
        @override
        _MyAppState createState() =&gt; _MyAppState();
      }
      
      class _MyAppState extends State&lt;MyApp&gt; {
      
        @override
        void initState() {
          super.initState();
      
          var resampler = Resampler(true, 2, 2);
          resampler.process(2, Float32List(160), false);
          resampler.process(2, Float32List(160), false);
          resampler.process(2, Float32List(160), false);
          resampler.process(2, Float32List(160), false);
          resampler.process(2, Float32List(160), true);
          resampler.close();
        }
      
        @override
        Widget build(BuildContext context) {
          return MaterialApp(
            home: Scaffold(
              appBar: AppBar(
                title: const Text('Plugin example app'),
              ),
              body: Center(
                child: Text('Testing'),
              ),
            ),
          );
        }
      }
  
  </code></pre>
  <p>Thanks for helping me</p>