DanBloomberg / leptonica

Leptonica is an open source library containing software that is broadly useful for image processing and image analysis applications. The official github repository for Leptonica is: danbloomberg/leptonica. See leptonica.org for more documentation.
Other
1.72k stars 384 forks source link

Unable to build leptonica.dll. #703

Closed naushadck closed 11 months ago

naushadck commented 1 year ago

Hello,

Building Leptonica in Windows 10 using cmake/Visual Studio 2022

  1. It is building .lib file successfully.
  2. Unable to build the same project in to .dll file.

    Leptonica.lib is generated. How can i generate Leptonica.dll . Any special steps to be followed ?. Appreciate your help.

naushadck commented 11 months ago

The following steps did not create the .dll file.

md build cd build cmake .. cmake --build .

The following steps worked for me.

  1. Added the following in the CMakeLists.txt file. option(BUILD_SHARED_LIBS "Build using shared libraries" ON)

Issue in the test/production environment

But while use this in the test/production environment, it is asking for the dependent dll files (org.sw.demo.jpeg.dll. org.sw.demo.giff.dll, org.sw.demo.tiff.dll etc...)

Any idea how can we build the .dll library included with dependent dlls.

naushadck commented 11 months ago

I got the solution from issue #375

Following steps worked for me

mkdir build && cd build cmake -DBUILD_SHARED_LIBS=1 -DSW_BUILD_SHARED_LIBS=0 .. cmake --build . --config release

Thanks to egorpugin

DanBloomberg commented 11 months ago

@egorpugin

Hi Egor,

I am looking at the README.html. In the section (3) Using cmake, starting at line 291, it says the default is to build shared libraries, and there is no discussion of dlls. Also no mention of DSW_BUILD_SHARED_LIBS.

Can you please add the relevant information from this issue?

Dan

egorpugin commented 11 months ago

Hi,

I've added the following comment there.

       * To make a dynamic library (default) and STATIC (or builtin) dependencies:
            cmake .. -DSW_BUILD_SHARED_LIBS=0
            make
DanBloomberg commented 11 months ago

Thanks Egor. Closing because the issue is resolved.