Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7781673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:18:14+00:00 2026-06-01T19:18:14+00:00

I have pdflib_py.so library i want to call from haskell. I do not have

  • 0

I have pdflib_py.so library i want to call from haskell. I do not have a header file. And as you can see the lib’s name is not in the standard libbla form.

How do i access it from haskell ?

I followed c2hs tutorial. But it requires a header file (which i do not have) and ghc requires a library name to be in libbla format. I could of course rename pdflib_py.so to libpdfpy.so, in fact i tried it (it did not work), but that’s silly to assume that you cannot access a library from haskell because of its name. I’m surely missing something here.

You can download the pdflib library from here http://www.pdflib.com/download/pdflib-family/pdflib-8/

They have bundles for c++, java, php, python etc.

Why don’t i use c++ library but a python one ? Well, c++ library libbpdf.a requires to be compiled with g++. And haskell does not work with g++, I would have to write a C wrapper first. Luckily someone already did it for me. That’s what a pdflib_py.so is – a c wrapper over libpdf library.

So, how do i use a library with non standard name and no header file from haskell ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:18:16+00:00Added an answer on June 1, 2026 at 7:18 pm

    I dont think your approach is correct. You should compile pdflib with g++ into a shared library and then link against it. The C++ library they provide already uses “extern C” wrapper so the symbols exported will be excatly as you would expect them to be.

    To sum up, I propose the following solution:

    1. Download C++ bundle
    2. Compile with g++ to make shared .so library
    3. Use header .h file from bundle to make Haskell bindings
    4. Link Haskell code against .so library
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have one Doubt In MVC Architecture we can able to pass data from Controller
I have a PDF file ad I want to add a image in the
Have you seen library for flexible working with terminal(Unix like)? I want to implement
Have order header and details tables, want to grab all the header columns and
have a nice day. I got problem when trying to create an image from
I need to dinamicaly generate a PDF from HTML, but I have PDF Support
Have converted devise new session from erb to Haml but doens't work, this is
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:
Have finally got a responsive site working (of a fashion). What I want to
Have a question - you see a lot of free font conversion tools online.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.