Menu

Using DjVu as a library

2019-06-06
2019-06-07
  • Bruno Baruffaldi

    Hello, I would like to use DjVu in project as a library but I cannot find any documentation related to DjVu C++ library.

    Can someone tell me how to compile this code?

    // File A.cpp
    #include <iostream>
    #include <libdjvu/ddjvuapi.h>
    #include <libdjvu/miniexp.h>
    
    int main(void){
    
        std::cout << ddjvu_get_version_string() << std::endl;
    
        return 0;
    }
    

    I am trying to compile with g++ -std=c++11 A.cpp -o A

    If I change ddjvu_get_version_string() for DDJVUAPI_VERSION the program works. But if I use the function g++ fails with an undefined reference.
    Is there any namespace or flag that I must add to compile?

     
    • Leon Bottou

      Leon Bottou - 2019-06-06

      Try to find out with pkg-config:

      $ pkg-config --cflags ddjvuapi

      $ pkg-config --libs ddjvuapi

      From: Bruno Baruffaldi barufa@users.sourceforge.net
      Reply-To: "[djvu:discussion]" 103286@discussion.djvu.p.re.sourceforge.net
      Date: Thursday, June 6, 2019 at 9:28 AM
      To: "[djvu:discussion]" 103286@discussion.djvu.p.re.sourceforge.net
      Subject: [djvu:discussion] Using DjVu as a library

      Hello, I would like to use DjVu in project as a library but I cannot find any documentation related to DjVu C++ library.

      Can someone tell me how to compile this code?

      // File A.cpp

      include <iostream></iostream>

      include <libdjvu ddjvuapi.h=""></libdjvu>

      include <libdjvu miniexp.h=""></libdjvu>

      int main(void){

      std::cout << ddjvu_get_version_string() << std::endl;

      return 0;
      }
      I am trying to compile with g++ -std=c++11 A.cpp -o A

      If I change ddjvu_get_version_string() for DDJVUAPI_VERSION the program works. But if I use the function g++ fails with an undefined reference.
      Is there any namespace or flag that I must add to compile?

      Using DjVu as a library

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/djvu/discussion/103286/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • Bruno Baruffaldi

    Thanks!, it was really helpful :)

     

Log in to post a comment.