Page 1 of 1

Build wxwidgets with system library

Posted: Tue Sep 18, 2018 12:31 pm
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?

Re: Build wxwidgets with system library

Posted: Tue Sep 18, 2018 4:28 pm
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.

Re: Build wxwidgets with system library

Posted: Tue Sep 18, 2018 4:42 pm
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