cmake and wxWidgets

599 views
Skip to first unread message

Maxim Pichler

unread,
Jun 20, 2018, 1:18:29 AM6/20/18
to hugin and other free panoramic software
Hi,

I'm trying to build hugin-2018.0.0 (requires wxWidgets 3) on OpenBSD (which currently only has a package for wxWidgets 2.8). So I installed wxWidgets 3.0.4 in my home directory. How can I tell cmake where it is located?

Even with wx-config on the path cmake fails with:
  Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
  wxWidgets_INCLUDE_DIRS)

Trying to set these variables on the command line (e.g. -DwxWidgets_LIBRARIES=/home/maxim/opt/wxWidgets-3.0.4/lib) seems to have no effect.

Thanks for any insights!

Max

Jan Dubiec

unread,
Jun 20, 2018, 1:54:40 AM6/20/18
to hugi...@googlegroups.com
I have never built any software on *BSD, but you might try to add
-DwxWidgets_CONFIG_OPTIONS="--prefix=/home/maxim/opt/wxWidgets-3.0.4" to
CMake options. The prefix is passed to wx-config script and overrides
default prefix which is /usr/local or something similiar.

/J.D.

Maxim Pichler

unread,
Jun 20, 2018, 4:15:28 AM6/20/18
to hugin and other free panoramic software
On Wednesday, June 20, 2018 at 7:54:40 AM UTC+2, jdx wrote:
you might try to add
-DwxWidgets_CONFIG_OPTIONS="--prefix=/home/maxim/opt/wxWidgets-3.0.4" to
CMake options. The prefix is passed to wx-config script and overrides
default prefix which is /usr/local or something similiar.

This resulted in the same error, but made me realise that the path to wx-config itself needs to be specified. Indeed the option -DwxWidgets_CONFIG_EXECUTABLE=/home/maxim/opt/wxWidgets-3.0.4/bin/wx-config made the configuration step succeed.

However now 'make' fails with:
/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin1/base_wx/libhuginbasewx.so.0.0: undefined reference to `wxLogStream::wxLogStream(std::__1::basic_ostream<char, std::__1::char_traits<char> >*)'
/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin1/base_wx/libhuginbasewx.so.0.0: undefined reference to `operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, wxScopedCharTypeBuffer<char> const&)'
/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin1/base_wx/libhuginbasewx.so.0.0: undefined reference to `operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, wxString const&)'

This comes from the invocation of:
/usr/bin/c++   -pthread -g -DNDEBUG   CMakeFiles/hugin_stitch_project.dir/hugin_stitch_project.cpp.o  -o hugin_stitch_project  -L/usr/local/lib  -L/home/maxim/opt/wxWidgets-3.0.4/lib  -L/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin1/base_wx  -L/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin_base  -L/usr/X11R6/lib -Wl,-rpath,/usr/local/lib:/home/maxim/opt/wxWidgets-3.0.4/lib:/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin1/base_wx:/home/maxim/Downloads/hugin-2018.0.0/mybuild/src/hugin_base: -lhuginbasewx -lhuginbase -lpano13 ../../foreign/levmar/libhuginlevmar.a -lGLEW -lboost_filesystem-mt -lboost_system-mt -lfftw3 -lvigraimpex -lImath -lIlmImf -lIex -lHalf -lIlmThread -lz -ljpeg -ltiff -lpng -lz -lz -lexiv2 -llcms2 -lvigraimpex -lImath -lIlmImf -lIex -lHalf -lIlmThread -lz -ljpeg -ltiff -lpng -lz -lz -lexiv2 -L/home/maxim/opt/wxWidgets-3.0.4/lib -pthread -lwx_baseu-3.0 -lwx_gtk2u_core-3.0 -lwx_gtk2u_aui-3.0 -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_baseu_xml-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_gl-3.0 -lwx_baseu_net-3.0 -lwx_gtk2u_qa-3.0 -lX11 -lGL -lGLU -lsqlite3 -lpano13 -lGLEW -lboost_filesystem-mt -lboost_system-mt -lvigraimpex -ljpeg -lpng -ltiff -lexiv2 -llcms2 -Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib 

The missing symbol appears to actually be defined, but for some reason is not picked up by the linker:
$ nm /home/maxim/opt/wxWidgets-3.0.4/lib/libwx_baseu-3.0.so | grep wxLogStream
00094790 T _ZN11wxLogStream9DoLogTextERK8wxString
00094e80 T _ZN11wxLogStreamC1EPSo
00094710 T _ZN11wxLogStreamC2EPSo
0009a610 t _ZN11wxLogStreamD0Ev
0009a640 t _ZN11wxLogStreamD1Ev
004517b0 W _ZTI11wxLogStream
002ec04d W _ZTS11wxLogStream
004515e0 W _ZTV11wxLogStream

Thanks!

Maximilian Pichler

unread,
Jun 22, 2018, 1:37:35 AM6/22/18
to hugi...@googlegroups.com
Turns out this was due to wxWidget having been compiled with gcc and
hugins with clang. I'm not quite sure, but it appears that mixing
compilers is mostly fine for C, but less so for C++. The hugins
compilation finished successfully after recompiling wxWidgets with
./configure CC=cc CXX=c++. (cc and c++ refers to clang on OpenBSD.)
> --
> A list of frequently asked questions is available at:
> http://wiki.panotools.org/Hugin_FAQ
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "hugin and other free panoramic software" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/hugin-ptx/PUiYWBfoQ9c/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> hugin-ptx+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hugin-ptx/9708b1a5-9ac7-4955-b0ef-0005c3429a00%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Gunter Königsmann

unread,
Jun 22, 2018, 2:28:31 AM6/22/18
to hugi...@googlegroups.com

Turns out this was due to wxWidget having been compiled with gcc and
hugins with clang. I'm not quite sure, but it appears that mixing
compilers is mostly fine for C, but less so for C++. The hugins
compilation finished successfully after recompiling wxWidgets with
./configure CC=cc CXX=c++. (cc and c++ refers to clang on OpenBSD.)

That might be caused by the name mangling that converts methods and overloaded objects to linear names.
Reply all
Reply to author
Forward
0 new messages