using an external .pas fmx library with c-builder app

  

I’m new to this ide so bare with me.

I am trying to use this library (well the file utils)

FMX FlyFilesUtils

here is the generated .hpp:

// CodeGear C++Builder
// Copyright (c) 1995, 2015 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) ‘FlyFilesUtils.pas’ rev: 30.00 (Android)

#ifndef FlyfilesutilsHPP
#define FlyfilesutilsHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w- // All warnings off
#pragma option -Vx // Zero-length empty class member
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <Androidapi.JNIBridge.hpp>
#include <Androidapi.IOUtils.hpp>
#include <System.IOUtils.hpp>

//– user supplied ———————————————————–

namespace Flyfilesutils
{
//– forward type declarations ———————————————–
__interface TGetFileNameListener;
typedef System::DelphiInterface<TGetFileNameListener> _di_TGetFileNameListener;
//– type declarations ——————————————————-
__interface TGetFileNameListener : public System::IInterface
{
virtual void __fastcall Invoke(const bool IsOK, const System::UnicodeString FileName) = 0 ;
};

typedef void __fastcall (__closure *TGetFileNameLIsternerMethod)(const bool IsOK, const System::UnicodeString FileName);

//– var, const, procedure —————————————————
extern DELPHI_PACKAGE System::UnicodeString Error_NotFoundFileManager_Str;
static constexpr System::Int8 OTGDeivceCount = System::Int8(0x10);
static constexpr System::Byte UsbDiskIndex = System::Byte(0xff);
static constexpr System::Word CDROMIndex = System::Word(0x10f);
static constexpr System::Word DeleteDirectories_WaitMinSecond = System::Word(0x7d0);
extern DELPHI_PACKAGE bool __fastcall OpenFileOnExtApp(const System::UnicodeString FileName, bool Https = true);
extern DELPHI_PACKAGE bool __fastcall IsPadOrPC(float MiniScreenInches = 6.200000E+00f);
extern DELPHI_PACKAGE unsigned __int64 __fastcall GetTotalMemorySize(void);
extern DELPHI_PACKAGE unsigned __int64 __fastcall GetFreeMemorySize(void);
extern DELPHI_PACKAGE unsigned __int64 __fastcall GetTotalSpaceSize(System::UnicodeString Path = u”/”);
extern DELPHI_PACKAGE unsigned __int64 __fastcall GetFreeSpaceSize(System::UnicodeString Path = u”/”);
extern DELPHI_PACKAGE unsigned __int64 __fastcall GetAvailableSpaceSize(System::UnicodeString Path = u”/”);
extern DELPHI_PACKAGE bool __fastcall OpenFileDialog(System::UnicodeString Title, System::UnicodeString FileExtension, _di_TGetFileNameListener GetFileNameCallBack)/* overload */;
extern DELPHI_PACKAGE bool __fastcall OpenFileDialog(System::UnicodeString Title, System::UnicodeString FileExtension, TGetFileNameLIsternerMethod GetFileNameCallBack)/* overload */;
extern DELPHI_PACKAGE bool __fastcall GetIsExternalStorageRemovable(void);
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetExterStoragePath(void);
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetInnerStoragePath(void);
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetVolumePaths(void);
extern DELPHI_PACKAGE float __fastcall GetScreenInches(void);
extern DELPHI_PACKAGE bool __fastcall FindJavaClass(System::UnicodeString NamePath);
extern DELPHI_PACKAGE bool __fastcall FindJavaMethod(System::UnicodeString MethodName, System::UnicodeString Signature, System::UnicodeString CalssNamePath = System::UnicodeString());
extern DELPHI_PACKAGE bool __fastcall FindJavaStaticMethod(System::UnicodeString MethodName, System::UnicodeString Signature, System::UnicodeString CalssNamePath = System::UnicodeString());
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetExternalStoragePath(void);
extern DELPHI_PACKAGE bool __fastcall isPathCanUseNow(const System::UnicodeString PathOrDir, const bool Default = true);
extern DELPHI_PACKAGE System::UnicodeString __fastcall BuildFileListInAPath(const System::UnicodeString Path, const int Attr, bool JustFile = false)/* overload */;
extern DELPHI_PACKAGE bool __fastcall BuildFileListInAPath(const System::UnicodeString Path, const int Attr, System::Classes::TStrings* const List, bool JustFile = false)/* overload */;
extern DELPHI_PACKAGE bool __fastcall DeleteDirectoryByEcho(const System::UnicodeString Source, bool AbortOnFailure = false, bool YesToAll = true, int WaitMinSecond = 0x7d0);
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetFileNamesFromDirectory(const System::UnicodeString DirName, const System::UnicodeString SearchFilter = u”*”, const int FileAttribs = 0x1ff, const bool isIncludeSubDirName = false, const bool Recursion = false, const bool FullName = false);
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetCaseSensitiveFileName(const System::UnicodeString FileName, System::UnicodeString RootPath = System::UnicodeString());
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetSDCardPath(int Index = 0x0);
extern DELPHI_PACKAGE System::UnicodeString __fastcall FindSDCardSubPath(System::UnicodeString SubPath, int Index = 0x0);
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetAppPath(void);
} /* namespace Flyfilesutils */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_FLYFILESUTILS)
using namespace Flyfilesutils;
#endif
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//– end unit —————————————————————-
#endif // FlyfilesutilsHPP

now here is the code calling OpenFileDialog function:

#include <fmx.h>
#pragma hdrstop

#include “Unit2.h”
#include “Unit1.h”
#include “FlyFilesUtils.hpp”
//—————————————————————————
#pragma package(smart_init)
#pragma resource “*.fmx”
#pragma resource (“*.NmXhdpiPh.fmx”, _PLAT_ANDROID)
#pragma resource (“*.LgXhdpiPh.fmx”, _PLAT_ANDROID)
#pragma resource (“*.LgXhdpiTb.fmx”, _PLAT_ANDROID)

TForm2 *Form2;

void __fastcall TForm2::Button4Click(TObject *Sender)
{
String FileExt ;
FileExt = “txt”;
if (!OpenFileDialog((System::UnicodeString)”select file”, FileExt, GetFileName))
{

}
}
//—————————————————————————
void __fastcall TForm2::GetFileName(const bool IsOK , const System::UnicodeString FileName )
{
if (IsOK==true) {
Edit2->Text = FileName;

}
else
{
Edit2->Text = “Invalide filename”;

}
}

from this i get the following compiler error:

[ldandroid Error] C:\Users\Public\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: .\Android\Release\Unit2.o: in function TForm2::Button4Click(System::TObject*):.\Android\Release\Unit2.o.ll(.text._ZN6TForm212Button4ClickEPN6System7TObjectE+0x5e): error: undefined reference to ‘Flyfilesutils::OpenFileDialog(System::UnicodeString, System::UnicodeString, void (* __closure)(bool, System::UnicodeString))’

Any ideas?

Comments are closed.