I'm trying to connect POCO libraries. I collected a project dll for working with ZIP . Connecting dll , to your project, produced by simply adding dll to the solution.

Found an example in which it was told: how to cause functions from dll . A function pointer is created, etc., but in the example, in the method signature, standard data types are used. In my case, user-defined types from dll come to parameters (maybe even from another one, on the basis of which the first dll was collected).

Is it possible to connect the dll in the code and access its functions for my case?

Example of creating a function pointer:

 typedef void(*LibraryFunction)(std::istream&, const Poco::DateTime&, const Poco::Path&, ZipCommon::CompressionMethod, ZipCommon::CompressionLevel); 

Parameters with the Poco :: and ZipCommon spaces indicate an error: must be a class or namespace. As I understand it, because such a space does not exist in my project and cannot be seen from the dll.

  • You suggest to guess what data types in your case? Loading a DLL and getting the address of a function in it does not require knowledge of the types at all. Types are needed to declare a pointer of the desired type, read about function pointers. - Vladimir Martyanov
  • Well, what am I talking about? How can I write a function pointer if the parameter types for it are not visible from the dll? - Sergey
  • And how then did the DLL get together, if it doesn't know anything about the types of its arguments? Something you do not understand. - Vladimir Martyanov
  • 2
    You need to either 1) connect the header of the Poco library that contains DateTime, then there will be a type match, or 2) use anonymous pointers of the type void *, but you can always connect the library. 3) if DateTime matches the standard DateTime, then write DateTime & without specifying Poco, but if it doesn’t match, you risk getting the software to work incorrectly and Exception. 4) as an extreme working option, copy the DateTime advertisement from the Poco library and work with it, but then point 1 is simpler. - nick_n_a
  • one
    Similarly with ZipCommon. I will explain, h-files are used for declaring structures and functions, and c / cpp files for implementation (collection in exe or dll). Therefore, you all need to make the type #include "poco.h" and #include "ZipCommon.h" files I try to guess, they may differ. - nick_n_a

1 answer 1

It is necessary in that cpp or h, where Poco :: Zip: Common is used, add #include <Poco / Zip / ZipCommon.h> , you can do the same with other components of the framework.

In the link, specify the PocoFoundation library . PocoZip Next, set the search paths for libraries and headers (it all depends on your IDE and build system). In general, this scheme for any library or framework will be similar.