Build wxwidgets with system library

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Laurent Berger
Earned some good credits
Earned some good credits
Posts: 138
Joined: Tue May 20, 2008 1:03 pm

Build wxwidgets with system library

Post by Laurent Berger »

Hi,

I use CMake (3.11.0) to build wxWidgets (staticlib = wxBUILD_SHARED_OFF) on windows (VS 2017 Win64). I want to use the inside opencv libs for PNG ZLIB and TIFF to avoid duplicate symbols when I link my application.
After many tries (something is wrong in CMake-GUI when wxBUILDPNG is sys) ihave got in my cmake cache :

Code: Select all

//Path to a library.
PNG_LIBRARY_DEBUG:FILEPATH=C:/Install/opencv/x64/vc15/staticlib/libpngd.lib
//Path to a library.
PNG_LIBRARY_RELEASE:FILEPATH=C:/Install/opencv/x64/vc15/staticlib/libpng.lib
//Path to a file.
PNG_PNG_INCLUDE_DIR:PATH=C:/Lib/opencv/3rdparty/libpng
//Path to a file.
TIFF_INCLUDE_DIR:PATH=C:/Lib/opencv/3rdparty/libtiff/
//Path to a library.
TIFF_LIBRARY_DEBUG:FILEPATH=C:/Install/opencv/x64/vc15/staticlib/libtiffd.lib
//Path to a library.
TIFF_LIBRARY_RELEASE:FILEPATH=C:/Install/opencv/x64/vc15/staticlib/libtiff.lib
//Path to a file.
ZLIB_INCLUDE_DIR:PATH=C:/Lib/opencv/3rdparty/zlib
//Path to a library.
ZLIB_LIBRARY_DEBUG:FILEPATH=C:/Install/opencv/x64/vc15/staticlib/zlibd.lib
//Path to a library.
ZLIB_LIBRARY_RELEASE:FILEPATH=C:/Install/opencv/x64/vc15/staticlib/zlib.lib
When I compile wxwidgets I have got an error in opencv file https://github.com/opencv/opencv/blob/m ... tiff.h#L30 cannot find tiffconf.h
I add tiffconf. path to core projects and I can build all libs
Does it mean that something is wrong in Cmake configuration or may be it is not possible to use opencv libtiff to build wxwidgets?
L.B.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 550
Joined: Fri Nov 03, 2006 2:00 pm

Re: Build wxwidgets with system library

Post by stahta01 »

You likely need to build wxWidgets and OpenCV with the same PNG ZLIB and TIFF libs; but, this is just a guess on my part.

Edit: And, you appear to be trying that; I am thinking you need a cmake expert.
I suggest when asking CMake questions you put cmake in the subject.

Tim S.
Laurent Berger
Earned some good credits
Earned some good credits
Posts: 138
Joined: Tue May 20, 2008 1:03 pm

Re: Build wxwidgets with system library

Post by Laurent Berger »

stahta01 wrote:You likely need to build wxWidgets and OpenCV with the same PNG ZLIB and TIFF libs
Now I have got wxWidgets and Opencv with same PNG ZLIB and TIFF but process is not automatic : add path tiffconf.h

When wxwidgets uses libtiff tiff.h and tiffconf.h files are in same directory. It is not true for OpenCV

I will try : get rid off libtiff inside wxwidgets : i don't need it -> i use opencv to load image

NEW now with wxNano it is possible to use mouseCallback as cv::mouseCallback and I start createTrackbar
L.B.
Post Reply