Discussion:
Building libtiff 4.0.3 dll on mingw win32
Lyndon Hill
2014-04-06 19:53:50 UTC
Permalink
I'm trying to build a libtiff dll under mingw (msys in fact).

After unzipping the source, I can do a configure and make with no problems.
I give configure the path to libjpeg, as I have already compiled and installed that into mingw.

The output of make is libtiff.a and libtiff.la, no dll.


configure says that --enable-shared defaults to true
I think it's not identifying that a Windows dll is required.

I don't normally develop on Windows. Can anyone help me get configure to set up a makefile to build a dll ?
Bob Friesenhahn
2014-04-06 20:12:52 UTC
Permalink
Post by Lyndon Hill
I'm trying to build a libtiff dll under mingw (msys in fact).
After unzipping the source, I can do a configure and make with no problems.
I give configure the path to libjpeg, as I have already compiled and installed that into mingw.
The output of make is libtiff.a and libtiff.la, no dll.
Usually you should get lib/libtiff.a, lib/libtiff.dll.a,
lib/libtiff.la, bin/libtiff-5.dll, and the libtiffxx equivalents for
C++.

The libraries that libtiff depends on should also be built as DLLs.

I install under a common prefix using --prefix (e.g. /usr/local).

Be sure to do 'make install' for each library as soon as it is built.

You should include ${prefix}/bin (where ${prefix} is the prefix you
supplied to configure) in the PATH environment variable. This allows
the DLLs to be found at run-time since Windows searches in the
executable search path.

It is useful to watch the configure and build output for any clues as
to why something is not working as you expect. Usually libtool offers
some useful clues (e.g. "Did not find DLL for blah blah").

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
_______________________________________________
Tiff mailing list: ***@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Lyndon Hill
2014-04-07 20:07:09 UTC
Permalink
I can't see any problems from the configure script; I've added the last bit of output to the end.

For mingw, I installed Qt 5.2.1 which includes mingw 4.8, 32 bit. I'm also running msys 1.0.11. 

gcc reports a target of i686-w64-mingw32 and is the one from Qt. Now I'm confused, is this 32 or 64 bit.

From configure:

checking whether the gcc linker (c:/qt/tools/mingw48_32/i686-w64-mingw32/bin/ld.exe) supports shared libraries... yes

Here is the last bit of output from configure:

Libtiff is now configured for i686-pc-mingw32

  Installation directory:             /c/Users/me/Source/tiff-4.0.3/tiff-build
  Documentation directory:            ${prefix}/share/doc/tiff-4.0.3
  C compiler:                         gcc -g -O2 -Wall -W
  C++ compiler:                       g++ -g -O2
  Enable runtime linker paths:        no
  Enable linker symbol versioning:    no
  Support Microsoft Document Imaging: yes
  Use win32 IO:                       yes

 Support for internal codecs:
  CCITT Group 3 & 4 algorithms:       yes
  Macintosh PackBits algorithm:       yes
  LZW algorithm:                      yes
  ThunderScan 4-bit RLE algorithm:    yes
  NeXT 2-bit RLE algorithm:           yes
  LogLuv high dynamic range encoding: yes

 Support for external codecs:
  ZLIB support:                       yes
  Pixar log-format algorithm:         yes
  JPEG support:                       yes
  Old JPEG support:                   yes
  JPEG 8/12 bit dual mode:            no
  ISO JBIG support:                   no
  LZMA2 support:                      no

  C++ support:                        yes

  OpenGL support:                     no
Hi Bob, thanks for your suggestions.
When I extracted libtiff sources I also created a "build" directory and then ./configure
--prefix=/c/Users/me/tiff/build so that I can see what is built and where it goes after I do make install. There
is no dll in the bin directory or lib/libtiff.dll.a. I think configure is not creating a Makefile that builds it.
Which of the many flavors and versions of MinGW are you using?

I am using a build from the MinGW64 project.

Configure prints this early on while it is configuring the libtool
parts:

checking whether the /mingw64/bin/gcc linker
(c:/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared
libraries... yes

It is good to check the messages that configure prints, and also any
messages printed while linking the libraries.

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Bob Friesenhahn
2014-04-07 21:00:07 UTC
Permalink
Post by Lyndon Hill
I can't see any problems from the configure script; I've added the last bit of output to the end.
For mingw, I installed Qt 5.2.1 which includes mingw 4.8, 32 bit. I'm also running msys 1.0.11. 
gcc reports a target of i686-w64-mingw32 and is the one from Qt. Now I'm confused, is this 32 or 64 bit.
The naming is confusing. I think that the w64 variants can produce 32
bit or 64-bit code (-m32, or -m64).

It would be good to capture the text while the tiff libraries are
being linked.

The last bit of configure output is not very useful to solve this
problem.

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Lyndon Hill
2014-04-08 20:39:49 UTC
Permalink
Looking further into the output of make I discovered that although configure had found zlib, during the build a shared zlib could not be found and therefore a shared tiff would not be built.

After fixing the zlib problem, I could build libtiff dlls.

Thanks for your help.
Post by Lyndon Hill
I can't see any problems from the configure script; I've added the last bit of output to the end.
For mingw, I installed Qt 5.2.1 which includes mingw 4.8, 32 bit. I'm also running msys 1.0.11. 
gcc reports a target of i686-w64-mingw32 and is the one from Qt. Now I'm confused, is this 32 or 64 bit.
The naming is confusing.  I think that the w64 variants can produce 32
bit or 64-bit code (-m32, or -m64).

It would be good to capture the text while the tiff libraries are
being linked.

The last bit of configure output is not very useful to solve this

problem.

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Loading...