Skip to content

Make error on Ubuntu 15.10 (undefined reference to boost::filesystem::path_traits::dispatch) #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dbergan opened this issue Dec 22, 2015 · 12 comments
Assignees

Comments

@dbergan
Copy link

dbergan commented Dec 22, 2015

Hi,

Was following the Linux build instructions on a brand new cloud instance of Ubuntu 15.10 (at Google compute engine). Came to this nasty looking problem in the make step.

Please help!

Kind regards,
David

~/casablanca/Release/build.release$ make

Scanning dependencies of target cpprest
[  0%] Building CXX object src/CMakeFiles/cpprest.dir/http/client/http_client_msg.cpp.o
[  1%] Building CXX object src/CMakeFiles/cpprest.dir/http/client/x509_cert_utilities.cpp.o
[  2%] Building CXX object src/CMakeFiles/cpprest.dir/http/common/http_helpers.cpp.o
[  3%] Building CXX object src/CMakeFiles/cpprest.dir/http/common/http_msg.cpp.o
[  3%] Building CXX object src/CMakeFiles/cpprest.dir/http/listener/http_listener.cpp.o
[  4%] Building CXX object src/CMakeFiles/cpprest.dir/http/listener/http_listener_msg.cpp.o
[  5%] Building CXX object src/CMakeFiles/cpprest.dir/http/listener/http_server_api.cpp.o
[  5%] Building CXX object src/CMakeFiles/cpprest.dir/http/oauth/oauth1.cpp.o
[  6%] Building CXX object src/CMakeFiles/cpprest.dir/http/oauth/oauth2.cpp.o
[  7%] Building CXX object src/CMakeFiles/cpprest.dir/json/json.cpp.o
[  8%] Building CXX object src/CMakeFiles/cpprest.dir/json/json_parsing.cpp.o
[  8%] Building CXX object src/CMakeFiles/cpprest.dir/json/json_serialization.cpp.o
[  9%] Building CXX object src/CMakeFiles/cpprest.dir/pplx/pplx.cpp.o
[ 10%] Building CXX object src/CMakeFiles/cpprest.dir/uri/uri.cpp.o
[ 10%] Building CXX object src/CMakeFiles/cpprest.dir/uri/uri_builder.cpp.o
[ 11%] Building CXX object src/CMakeFiles/cpprest.dir/uri/uri_parser.cpp.o
[ 12%] Building CXX object src/CMakeFiles/cpprest.dir/utilities/asyncrt_utils.cpp.o
[ 13%] Building CXX object src/CMakeFiles/cpprest.dir/utilities/base64.cpp.o
[ 13%] Building CXX object src/CMakeFiles/cpprest.dir/utilities/web_utilities.cpp.o
[ 14%] Building CXX object src/CMakeFiles/cpprest.dir/websockets/client/ws_msg.cpp.o
[ 15%] Building CXX object src/CMakeFiles/cpprest.dir/websockets/client/ws_client.cpp.o
[ 16%] Building CXX object src/CMakeFiles/cpprest.dir/websockets/client/ws_client_wspp.cpp.o
[ 16%] Building CXX object src/CMakeFiles/cpprest.dir/streams/fileio_posix.cpp.o
[ 17%] Building CXX object src/CMakeFiles/cpprest.dir/pplx/threadpool.cpp.o
[ 18%] Building CXX object src/CMakeFiles/cpprest.dir/http/client/http_client_asio.cpp.o
[ 18%] Building CXX object src/CMakeFiles/cpprest.dir/http/listener/http_server_asio.cpp.o
[ 19%] Building CXX object src/CMakeFiles/cpprest.dir/pplx/pplxlinux.cpp.o
Linking CXX shared library ../Binaries/libcpprest.so
[ 19%] Built target cpprest
Scanning dependencies of target unittestpp
[ 20%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/AssertException.cpp.o
[ 21%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/CompositeTestReporter.cpp.o
[ 22%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/CurrentTest.cpp.o
[ 22%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/DeferredTestReporter.cpp.o
[ 23%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/DeferredTestResult.cpp.o
[ 24%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/GlobalSettings.cpp.o
[ 24%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/MemoryOutStream.cpp.o
[ 25%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/ReportAssert.cpp.o
[ 26%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/Test.cpp.o
[ 27%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/TestDetails.cpp.o
[ 27%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/TestList.cpp.o
[ 28%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/TestReporter.cpp.o
[ 29%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/TestReporterStdout.cpp.o
[ 30%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/TestResults.cpp.o
[ 30%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/TestRunner.cpp.o
[ 31%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/XmlTestReporter.cpp.o
[ 32%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/Posix/SignalTranslator.cpp.o
[ 32%] Building CXX object tests/common/UnitTestpp/CMakeFiles/unittestpp.dir/src/Posix/TimeHelpers.cpp.o
Linking CXX shared library ../../../Binaries/libunittestpp.so
[ 32%] Built target unittestpp
Scanning dependencies of target common_utilities
[ 33%] Building CXX object tests/common/utilities/CMakeFiles/common_utilities.dir/os_utilities.cpp.o
[ 34%] Building CXX object tests/common/utilities/CMakeFiles/common_utilities.dir/stdafx.cpp.o
Linking CXX shared library ../../../Binaries/libcommon_utilities.so
[ 34%] Built target common_utilities
Scanning dependencies of target test_runner
[ 35%] Building CXX object tests/common/TestRunner/CMakeFiles/test_runner.dir/test_runner.cpp.o
[ 35%] Building CXX object tests/common/TestRunner/CMakeFiles/test_runner.dir/test_module_loader.cpp.o
Linking CXX executable ../../../Binaries/test_runner
CMakeFiles/test_runner.dir/test_runner.cpp.o: In function `load_all_tests(test_module_loader&)':
test_runner.cpp:(.text+0xc47): undefined reference to `boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)'
collect2: error: ld returned 1 exit status
tests/common/TestRunner/CMakeFiles/test_runner.dir/build.make:113: recipe for target 'Binaries/test_runner' failed
make[2]: *** [Binaries/test_runner] Error 1
CMakeFiles/Makefile2:265: recipe for target 'tests/common/TestRunner/CMakeFiles/test_runner.dir/all' failed
make[1]: *** [tests/common/TestRunner/CMakeFiles/test_runner.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2
@dbergan
Copy link
Author

dbergan commented Dec 22, 2015

Possibly related... When I ran:
sudo apt-get install g++-4.8 g++ git make libboost1.54-all-dev libssl-dev cmake

It had an error on libboost...

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libboost1.54-all-dev
E: Couldn't find any package by regex 'libboost1.54-all-dev'

So I used this instead:
sudo apt-get install libboost-all-dev

And that installed libboost1.58 instead of 1.54

@robertbindar
Copy link

I couldn't make it work with 1.58 boost, it did compile though with 1.54. But now I've just written a simple http server and I cannot reply to any http request. Calling http_request::reply method causes a SIGSEGV every time. Does anyone know something about this?

@ras0219-msft ras0219-msft self-assigned this Jan 5, 2016
@damienhocking
Copy link

David,

A while back I posted Linux build instructions here:

https://casablanca.codeplex.com/discussions/571458

We use that to build on Linux, it makes it easier to update your own Boost versions etc. It still works today with Casablanca 2.7 and Boost 1.59.

Damien

@ras0219-msft
Copy link
Contributor

The original issue was that we were not properly linking boost_filesystem into the test_runner executable. Once I check in the fix for that, we should work on ubuntu 15.10 with boost 1.58.

@ras0219-msft
Copy link
Contributor

The fix for this is checked in and we should now build cleanly on Ubuntu 15.10. Please try it out and let us know if this solves your issues.

@rohit06nitbpl
Copy link

hi, I am trying to build casablanca today

I also get error:

CMakeFiles/test_runner.dir/test_runner.cpp.o: In function load_all_tests(test_module_loader&)': test_runner.cpp:(.text+0xc47): undefined reference toboost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)'
collect2: error: ld returned 1 exit status
tests/common/TestRunner/CMakeFiles/test_runner.dir/build.make:113: recipe for target 'Binaries/test_runner' failed
make[2]: *** [Binaries/test_runner] Error 1
CMakeFiles/Makefile2:265: recipe for target 'tests/common/TestRunner/CMakeFiles/test_runner.dir/all' failed
make[1]: *** [tests/common/TestRunner/CMakeFiles/test_runner.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2

@rohit06nitbpl
Copy link

Please Help :(

@ras0219-msft
Copy link
Contributor

Are you building the current master branch or the development branch? The changes are only present in the development branch. Make sure you have commit 95478a4 in your git log.

@epot
Copy link

epot commented Mar 15, 2016

I have the same issue with version 2.8.0 which contains the commit you are referring to. Any clue ?

@epot
Copy link

epot commented Apr 22, 2016

Any news on this one ? I am not able to use the SDK on Linux...

@epot
Copy link

epot commented Apr 22, 2016

Actually, I think the getting started guide is misleading: it suggests to force the compiler to gcc4.8 but it does not work if the boost package has been compiled with another compiler. On Ubuntu 15.10, I am now using the default gcc compiler coming with the distribution (5.2.1) and I am able to compile cpprestsdk just fine.

@ras0219-msft
Copy link
Contributor

Yes, that would be the issue. Thank you for bringing it up; it should no longer be needed to explicitly specify gcc-4.8 and it is clearly causing issues like the one you had.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants