tplgy / bonefish

C++ WAMP application router that enables building applications from loosely-coupled components.
Apache License 2.0
55 stars 33 forks source link

build problem cannot find boost #40

Open MarcelKraemer opened 8 years ago

MarcelKraemer commented 8 years ago

Hello, I am trying to build bonefish on windows 10. I installed QT and use MinGW which came with QT. The necessary boost libraries are compiled and located at C:\boost_1_61_0. The bonefish resources are located in C:\bonefish-master. Within that folder I created a build-folder (C:\bonefish-master\bonefish-build). Out of this folder I run the command “cmake -G "MinGW Makefiles" ../”. While the build process I get the attached error message. Basically the boost library is not found. Now the question arises where and how I have to specify the path to the boost library. What about the RT_Library? Thanks a lot in advance. Cheers Marcel cmake_cmd

CMakeOutput.TXT

MarcelKraemer commented 8 years ago

Problem was solved by setting the environment variable BOOST_ROOT to "C:\boost_1_61_0". Not sure if that is an appropriate way to solve the issue. Aadditiaonally I had to compile the boost:ProgramOptions library as well. Maybe somone can add this dependency in the readme.

MarcelKraemer commented 8 years ago

now it shows me another message "-- could NOT find RT". Is that a problem, or can I just ignore it? 2016-08-01 5

davidchappelle commented 8 years ago

I am not current with mingw build environments but according to this article, there is no librt in Windows.

http://stackoverflow.com/questions/31054864/mingw-g-is-unable-to-link-with-libraries

Try using -lws2_32 instead of librt. Will have to tweak the cmake scripts and do the right thing for mingw/Windows. If you can get prepare a patch that would be great.

On Mon, Aug 1, 2016 at 8:05 AM, Marcel Kraemer notifications@github.com wrote:

now it shows me another message "-- could NOT find RT". Is that a problem, or can I just ignore it? [image: 2016-08-01 5] https://cloud.githubusercontent.com/assets/18499721/17293498/eb7e2eaa-57f0-11e6-85ed-9943a1d122bb.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tplgy/bonefish/issues/40#issuecomment-236562540, or mute the thread https://github.com/notifications/unsubscribe-auth/ACmyX-yIfWeJKGITiLuC6KwtSGBw-hgdks5qbeDwgaJpZM4JZZXF .

sourcerror commented 8 years ago

For me it worked if I edited "CMakeCache.txt" to : RT_LIBRARY:FILEPATH=C:/mingw32/i686-w64-mingw32/lib/libws2_32.a

Unfortunately if I try to build using GCC 5.3.0 with Boost 1.60 on Windows 7, I get an error in https://github.com/tplgy/bonefish/blob/master/src/bonefish/session/wamp_session.hpp line 50.

The error says:

error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]

Probably this is similar to the issue discussed here: http://stackoverflow.com/questions/4163126/dereferencing-type-punned-pointer-will-break-strict-aliasing-rules-warning But I don't know the best way to solve it yet.

Kind regards, Nico

davidchappelle commented 8 years ago

Is that file/line correct? I see a line of whitespace at that location.

On Mon, Sep 19, 2016 at 10:16 AM, sourcerror notifications@github.com wrote:

For me it worked if I edited "CMakeCache.txt" to : RT_LIBRARY:FILEPATH=C:/ mingw32/i686-w64-mingw32/lib/libws2_32.a

Unfortunately if I try to build using GCC 5.3.0 with Boost 1.60 on Windows 7, I get an error in https://github.com/tplgy/bonefish/blob/master/src/ bonefish/session/wamp_session.hpp line 50.

The error says:

error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]

Probably this is similar to the issue discussed here: http://stackoverflow.com/questions/4163126/dereferencing-type-punned- pointer-will-break-strict-aliasing-rules-warning But I don't know the best way to solve it yet.

Kind regards, Nico

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tplgy/bonefish/issues/40#issuecomment-248005793, or mute the thread https://github.com/notifications/unsubscribe-auth/ACmyX7nGFu8vy95F9T5WOAxobibI5sL6ks5qrplZgaJpZM4JZZXF .

sourcerror commented 8 years ago

No, I don't know how I got to that link, I must have mixed things up (a lot) when I was trying to find out what the problem was. It comes from this code:

    {
       BOOST_STATIC_ASSERT(sizeof(T)==sizeof(long));
       long const res=BOOST_INTERLOCKED_COMPARE_EXCHANGE(reinterpret_cast<long*>(target),
                                                         *reinterpret_cast<long*>(&new_value),
                                                         *reinterpret_cast<long*>(&comparand));
       return *reinterpret_cast<T const*>(&res);
   }

Which is in the Boost Thread library: http://www.boost.org/doc/libs/1_60_0/boost/thread/win32/shared_mutex.hpp line 50 and aparently that should be fixed since Boost version 1.54 https://svn.boost.org/trac/boost/ticket/6652, but I don't see a way around it. Probably that is my fault, as I also can't find where the shared_mutex is used yet.