0

I am trying to use the abbrevia package ( https://github.com/TurboPack/Abbrevia ) with c++Builder in a console application. First i tried to manually install the package. But then i found it on GetIt. Issue persists no matter how it setup the package. I think the path settings i did manually are the same as the package installer did. It results always in unresolved externel for Abdfbase::TAbDeflateHelper:: This is the original error message:

[ilink32 Fehler] Error: Nicht auflösbares externes 'Abdfbase::TAbDeflateHelper::' referenziert von c:\pathtotheobjectfile\main.obj

Just setting up the path and compiling the projects for the c++builder ( therefore getting the objects ) is all the setup aks for. And with GetIt i dont even have to do that.

This is my most simple start which i cant even get to link.

#pragma hdrstop
#pragma argsused

#ifdef _WIN32
#include <tchar.h>
#else
  typedef char _TCHAR;
  #define _tmain main
#endif

#include <stdio.h>
#include <AbDfBase.hpp>
using namespace Abdfbase;

int _tmain(int argc, _TCHAR* argv[]) 
{
    TAbDeflateHelper* helper = new TAbDeflateHelper();
    return 0;
}

This is my first try using c++builder. What system setting or special code am I missing?

For reference the start of the .hpp imported which show the class i try to instantiate.

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

// (DO NOT EDIT: machine generated header) 'AbDfBase.pas' rev: 35.00 (Windows)

#ifndef AbdfbaseHPP
#define AbdfbaseHPP

#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>

//-- user supplied -----------------------------------------------------------

namespace Abdfbase
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TAbDeflateHelper;
class DELPHICLASS TAbLogger;
class DELPHICLASS TAbNodeManager;
class DELPHICLASS EAbAbortProgress;
class DELPHICLASS EAbPartSizedInflate;
class DELPHICLASS EAbInflatePasswordError;
class DELPHICLASS EAbInternalInflateError;
class DELPHICLASS EAbInflateError;
class DELPHICLASS EAbInternalDeflateError;
class DELPHICLASS EAbDeflateError;
//-- type declarations -------------------------------------------------------
typedef System::StaticArray<int, 536870911> TAbDfIntegerList;

typedef TAbDfIntegerList *PAbDfIntegerList;

typedef void __fastcall (__closure *TAbProgressStep)(int aPercentDone);

class PASCALIMPLEMENTATION TAbDeflateHelper : public System::TObject
{
    typedef System::TObject inherited;
    
private:
    int FAmpleLength;
    int FChainLength;
    System::UnicodeString FLogFile;
    int FMaxLazy;
    TAbProgressStep FOnProgressStep;
    int FOptions;
    __int64 FPartSize;
    __int64 FSizeCompressed;
    __int64 FSizeNormal;
    __int64 FStreamSize;
    int FWindowSize;
    System::WideChar FZipOption;
    
protected:
    void __fastcall dhSetAmpleLength(int aValue);
    void __fastcall dhSetChainLength(int aValue);
    void __fastcall dhSetLogFile(const System::UnicodeString aValue);
    void __fastcall dhSetMaxLazy(int aValue);
    void __fastcall dhSetOnProgressStep(TAbProgressStep aValue);
    void __fastcall dhSetOptions(int aValue);
    void __fastcall dhSetWindowSize(int aValue);
    void __fastcall dhSetZipOption(System::WideChar aValue);
    
public:
    __fastcall TAbDeflateHelper();
    void __fastcall Assign(TAbDeflateHelper* aHelper);
    __property int AmpleLength = {read=FAmpleLength, write=dhSetAmpleLength, nodefault};
    __property int ChainLength = {read=FChainLength, write=dhSetChainLength, nodefault};
    __property System::UnicodeString LogFile = {read=FLogFile, write=dhSetLogFile};
    __property int MaxLazyLength = {read=FMaxLazy, write=dhSetMaxLazy, nodefault};
    __property int Options = {read=FOptions, write=dhSetOptions, nodefault};
    __property __int64 PartialSize = {read=FPartSize, write=FPartSize};
    __property System::WideChar PKZipOption = {read=FZipOption, write=dhSetZipOption, nodefault};
    __property __int64 StreamSize = {read=FStreamSize, write=FStreamSize};
    __property int WindowSize = {read=FWindowSize, write=dhSetWindowSize, nodefault};
    __property __int64 CompressedSize = {read=FSizeCompressed, write=FSizeCompressed};
    __property __int64 NormalSize = {read=FSizeNormal, write=FSizeNormal};
    __property TAbProgressStep OnProgressStep = {read=FOnProgressStep, write=dhSetOnProgressStep};
public:
    /* TObject.Destroy */ inline __fastcall virtual ~TAbDeflateHelper() { }
    
};
ab at f
  • 1
  • 1

1 Answers1

0

Setting up search paths doesn't tell the compiler/linker which specific libraries you are actually using. Your project is not linking to the Abbrevia package library, hence the error.

Had you created a GUI app instead and visually dropped the Abbrevia component(s) onto a TForm, TFrame, or TDataModule at design-time, the necessary package library reference(s) would have been added for you.

But, in a console app, without at least a TDataModule, you will have to manually add reference(s) to Abbrevia's .bpi package library(s) to the project.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • Thanks so far. Just to follow up on your answer with another question. Where or how is the process to add a reference to a c++ console app to be done? I cant find any reference option in the IDE. I am basically at the point where i stop investing time into this because its not really worth it. i might just do a delphi application. And doing a gui application is not an option because i need a console application that can receive input on stdin . – ab at f Feb 09 '22 at 11:11
  • I don't have specific details on-hand. I would suggest creating a GUI project and get the desired Abbrevia component(s) compiling in it, and then compare that project file against your console project file to see differences in library references. Also compare the source code, as there may be `#pragma`s added, etc. – Remy Lebeau Feb 09 '22 at 16:31