Project

General

Profile

Actions

Bug #3347

closed

cmake Cannot find boost

Added by Michael Shestero over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
06/19/2014
Due date:
% Done:

0%

Estimated time:

Description

Error:

CMake Error at CMakeLists.txt:371 (MESSAGE):

Could not find a boost installation in /usr.

I use ancient EEEbuntu 3.

cmake version 2.6-patch 2

boost from the standard system package (seems to be 1.34) appears in

/usr/include/boost/*

and

/usr/lib/boost/*

Actions #1

Updated by Koen Deforche over 10 years ago

  • Status changed from New to Feedback

Hey,

Boost 1.34 is too old. Wt needs at least 1.35 (but really, go for a more recent version!).

Regards,

koen

Actions #2

Updated by Michael Shestero over 10 years ago

Thank you.

I removed boost 1.34 and installed 1.37-dev from the system packages.

Still cannot compile:

shestero@shestero-laptop:~/Downloads/wt-3.3.3/build$ make

[ 0%] Building CXX object src/CMakeFiles/wt.dir/Wt/PopupWindow.o

In file included from /usr/include/boost/signals/trackable.hpp:14:0,

from /home/shestero/Downloads/wt-3.3.3/src/Wt/WObject:115,

from /home/shestero/Downloads/wt-3.3.3/src/Wt/WApplication:25,

from /home/shestero/Downloads/wt-3.3.3/src/Wt/PopupWindow.C:7:

/usr/include/boost/signals/connection.hpp: In member function 'boost::shared_ptrboost::signals::detail::basic_connection boost::signals::connection::get_connection() const':

/usr/include/boost/signals/connection.hpp:102:16: error: use of deleted function 'boost::shared_ptrboost::signals::detail::basic_connection::shared_ptr(const boost::shared_ptrboost::signals::detail::basic_connection&)'

....

Actions #3

Updated by Michael Shestero over 10 years ago

I turn off C++0x support (clean WT_CPP_11_MODE cmake variable) and goes farther:

[ 0%] Building CXX object src/CMakeFiles/wt.dir/Wt/PopupWindow.o

In file included from /usr/include/boost/date_time/gregorian/formatters.hpp:17:0,

from /usr/include/boost/date_time/gregorian/gregorian.hpp:25,

from /usr/include/boost/date_time/posix_time/time_formatters.hpp:12,

from /usr/include/boost/date_time/posix_time/posix_time.hpp:24,

from /usr/include/boost/date_time/local_time/local_time.hpp:11,

from /home/shestero/Downloads/wt-3.3.3/src/Wt/WLocale:13,

from /home/shestero/Downloads/wt-3.3.3/src/Wt/WApplication:29,

from /home/shestero/Downloads/wt-3.3.3/src/Wt/PopupWindow.C:7:

/usr/include/boost/date_time/date_formatting.hpp: In static member function 'static std::basic_string boost::date_time::ymd_formatter<ymd_type, format_type, charT>::ymd_to_string(ymd_type)':

/usr/include/boost/date_time/date_formatting.hpp:87:36: error: cannot call constructor 'std::locale::locale' directly [-fpermissive]

/usr/include/boost/date_time/date_formatting.hpp:87:36: error: for a function-style cast, remove the redundant '::locale' [-fpermissive]

make[2]: * [src/CMakeFiles/wt.dir/Wt/PopupWindow.o] Error 1

make[1]: * [src/CMakeFiles/wt.dir/all] Error 2

make: * [all] Error 2

Note. Also I didn't tell I have problem with creating Makefile during cmake process: it report parse error in script that discovered OpenGL (WtFindGL.txt). I didn't use OpenGL at all and I just commented several lines somewhere in the bottom of that script thal leave the OpenGL permanently undiscovered. The cmake now can be compleated:

SET (GL_FOUND FALSE)

#IF (WIN32 OR (GL_LIBRARIES AND GL_INCLUDE_DIR AND GLEW_INCLUDE_DIR))

  1. SET (GL_FOUND TRUE)
  2. SET (GL_INCLUDE_DIRS ${GL_INCLUDE_DIR} ${GLEW_INCLUDE_DIR})
    #ENDIF (WIN32 OR (GL_LIBRARIES AND GL_INCLUDE_DIR AND GLEW_INCLUDE_DIR))
Actions #4

Updated by Michael Shestero over 10 years ago

Well.

I changed 'std::locale::locale' to 'std::locale' in line#87 of the file /usr/include/boost/date_time/date_formatting.hpp and the wt compiled!

Right now I stopped here:

In file included from /usr/include/boost/thread/detail/platform.hpp:17:0,

from /usr/include/boost/thread/thread.hpp:12,

from /usr/include/boost/thread.hpp:13,

from /home/shestero/Downloads/wt-3.3.3/src/web/WebSession.h:18,

from /home/shestero/Downloads/wt-3.3.3/src/Wt/WApplication.C:20:

/usr/include/boost/config/requires_threads.hpp:29:4: error: #error "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS"

Actions #5

Updated by Wim Dumon over 10 years ago

If you get this error, it may help to remove your build directory completely and then run cmake, making sure that boost is found from the first run. CMake otherwise tends to remember that it did not find the boost thread library, and it's hard to make it change its mind afterwards.

Wim.

Actions #6

Updated by Michael Shestero over 10 years ago

Oh, thank you for reply.

I add " || defined(_GLIBCXX_HAS_GTHREADS) " into the boost/config/stdlib/libstdcpp3.hpp file to pass through above mentioned error: https://svn.boost.org/trac/boost/attachment/ticket/6165/libstdcpp3.hpp.patch

See: https://svn.boost.org/trac/boost/ticket/6165

Then I have to disable OpenSSL because of some error, related to libAsio:

[ 53%] Building CXX object src/CMakeFiles/wt.dir/Wt/Http/Client.o

In file included from /usr/include/boost/asio/ssl/stream_service.hpp:31:0,

from /usr/include/boost/asio/ssl/stream.hpp:31,

from /usr/include/boost/asio/ssl.hpp:22,

from /home/shestero/Downloads/wt-3.3.3/src/Wt/Http/Client.C:25:

/usr/include/boost/asio/ssl/detail/openssl_stream_service.hpp: In instantiation of 'boost::asio::ssl::detail::openssl_stream_service::handshake_handler<Stream, Handler>::handshake_handler(Handler, boost::asio::io_service&) [with Stream = boost::asio::basic_stream_socketboost::asio::ip::tcp; Handler = boost::function<void(const boost::system::error_code&)>]':

/usr/include/boost/asio/ssl/detail/openssl_stream_service.hpp:247:52: required from 'void boost::asio::ssl::detail::openssl_stream_service::async_handshake(boost::asio::ssl::detail::openssl_stream_service::impl_struct*&, Stream&, boost::asio::ssl::stream_base::handshake_type, Handler) [with Stream = boost::asio::basic_stream_socketboost::asio::ip::tcp; Handler = boost::function<void(const boost::system::error_code&)>; boost::asio::ssl::detail::openssl_stream_service::impl_type = boost::asio::ssl::detail::openssl_stream_service::impl_struct]'

/usr/include/boost/asio/ssl/stream_service.hpp:108:5: required from 'void boost::asio::ssl::stream_service::async_handshake(boost::asio::ssl::detail::openssl_stream_service::impl_struct
&, Stream&, boost::asio::ssl::stream_base::handshake_type, HandshakeHandler) [with Stream = boost::asio::basic_stream_socketboost::asio::ip::tcp; HandshakeHandler = boost::function<void(const boost::system::error_code&)>; boost::asio::ssl::stream_service::impl_type = boost::asio::ssl::detail::openssl_stream_service::impl_struct*]'

/usr/include/boost/asio/ssl/stream.hpp:228:5: required from 'void boost::asio::ssl::stream<Stream, Service>::async_handshake(boost::asio::ssl::stream_base::handshake_type, HandshakeHandler) [with HandshakeHandler = boost::function<void(const boost::system::error_code&)>; Stream = boost::asio::basic_stream_socketboost::asio::ip::tcp; Service = boost::asio::ssl::stream_service]'

/home/shestero/Downloads/wt-3.3.3/src/Wt/Http/Client.C:579:75: required from here

/usr/include/boost/asio/ssl/detail/openssl_stream_service.hpp:118:7: error: 'set_func' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]

Now I've got the linker error:

[ 79%] Built target wttest

Linking CXX executable test

../src/libwt.so.3.3.3: undefined reference to `boost::random_device::default_token'

../src/libwt.so.3.3.3: undefined reference to `boost::random_device::~random_device()'

../src/libwt.so.3.3.3: undefined reference to `boost::random_device::random_device(std::string const&)'

../src/libwt.so.3.3.3: undefined reference to `boost::random_device::operator()()'

collect2: error: ld returned 1 exit status

May I just disable wttest? I guess I don't need it. All I wanted to use WPdfRenderer class in bound with libHaru to save some tables into PDF files in my desktop application.

Actions #7

Updated by Michael Shestero over 10 years ago

I disable wttests using BUILD_TESTS and pass through.

Then I have to add #include

into the file Wt/Dbo/Json.C :

/home/shestero/Downloads/wt-3.3.3/src/Wt/Dbo/Json.C:66:25: error: 'strlen' is not a member of 'std'

make[2]: * [src/Wt/Dbo/CMakeFiles/wtdbo.dir/Json.o] Error 1

make[1]: * [src/Wt/Dbo/CMakeFiles/wtdbo.dir/all] Error 2

make: * [all] Error 2

And... It is built now!

But still cannot do the test application: ( http://redmine.emweb.be/attachments/561/xhtml2pdf.cc ):

g xhtml2pdf.cc -lwt -lhpdf

/usr/bin/ld: warning: libboost_random.so.1.55.0, needed by /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../libwt.so, not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libboost_regex.so.1.55.0, needed by /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../libwt.so, not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libboost_system.so.1.55.0, needed by /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../libwt.so, not found (try using -rpath or -rpath-link)

/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../libwt.so: undefined reference to `boost::random_device::default_token'

Actions #8

Updated by Koen Deforche over 10 years ago

Hey,

There's a lot of potential problems with boost_random which changed its mind of what is and what is not included in the library over time; see http://www.google.be/search?q=wt+boost+random

Regards,

koen

Actions #9

Updated by Michael Shestero over 10 years ago

The link errors were because my wrong configuration (wrong BOOST_PREFIX). As I wrote I use boost 1.37.

Now I reconfigure and rebuild the wt. (I also set WT_NO_BOOST_RANDOM flag).

The xhtml2pdf.cc builds and works.

Only I have problem: it completely replaced all cyrilic letters with questions.

Output:

Render.Block: unsupported element: html

Render.Block: unsupported element: head

Render.Block: unsupported element: META

Render.Block: unsupported element: title

Render.Block: unsupported element: body

WString: narrow(): loss of detail:

...etc...

I would like the libraries to be built in more easy way.

I am working under Ubuntu-like Linux. The next step I need to build these libraries using i586-mingw32msvc-g (GCC) 4.2.1-sjlj (mingw32-2) cross-comiler to make Windows executable. Is it possible?

So much ado in the native system worries me a bit!

I also have one unrelated question. I need something to create a pie chart diagram in my desktop application. 1) Could I use the WPieChar class to render it into png or some other image resourse just in memory? 2) May be I can get the chart as (X)HTML text by calling htmlText method and then display it by QWebView (I use Qt)?

Actions #10

Updated by Michael Shestero over 10 years ago

I reckon this issue should be closed.

I rise new issue #3365

http://redmine.emweb.be/issues/3365

Actions #11

Updated by Wim Dumon over 10 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF