vendredi 3 juillet 2020

Errors on build a small c program with library pdfium

I am trying to build the init.c with pdfium, to test if works. I have on dir at desktop, file init.c, pdfium.lib and public directory with header files of pdfium. init.c code is

    #include <fpdfview.h>
  int main() {
  FPDF_LIBRARY_CONFIG config;
  config.version = 2;
  config.m_pUserFontPaths = NULL;
  config.m_pIsolate = NULL;
  config.m_v8EmbedderSlot = 0;
  FPDF_InitLibraryWithConfig(&config);
  FPDF_DestroyLibrary();
  return 0;
}

Opening on Windows cmd type ...

 set PDF_LIBS="-lpdfium -lfpdfapi -lfxge -lfpdfdoc -lfxcrt -lfx_agg -lfxcodec -lfx_lpng -lfx_libopenjpeg -lfx_lcms2 -lfx_freetype -ljpeg -lfdrm -lpwl -lbigint -lformfiller -ljavascript -lfxedit"
set PDF_DIR=pdfium

Then trying to build with ...

 g++ -I $PDF_DIR/public -o init init.c -L $PDF_DIR/out/Debug -lstdc++ $PDF_LIBS

I am taking errors ...

>g++ -I $PDF_DIR/public -o init init.c -L $PDF_DIR/out/Debug -lstdc++ $PDF_LIBS

g++: error: $PDF_LIBS: No such file or directory

Any idea why? I have take instructions from https://pdfium.googlesource.com/pdfium/+/master/docs/getting-started.md Thank you Jim

Aucun commentaire:

Enregistrer un commentaire