Building libtorrent, cannot find boost headers - c++

I'm trying to build libtorrent library found here.
I've followed the instructions found in this tutorial, and yet after executing bjam command I'm getting error saying that
...failed gcc.compile.c++ bin\gcc-mingw-5.1.0\debug\link-static\threading-multi\src\parse_url.o...
gcc.compile.c++ bin\gcc-mingw-5.1.0\debug\link-static\threading-multi\src\ConvertUTF.o
In file included from include/libtorrent/ConvertUTF.h:91:0,
from src\ConvertUTF.cpp:42:
include/libtorrent/config.hpp:45:28: fatal error: boost/config.hpp: No such file or directory
compilation terminated.
Anyone has any idea how to fix it?
/EDIT/
I went even further, I've replaced each include directory from relative to absolute and !!!still!!! I am getting identical error:
...failed gcc.compile.c++ bin\gcc-mingw-5.1.0\debug\link-static\threading-multi\src\policy.o...
gcc.compile.c++ bin\gcc-mingw-5.1.0\debug\link-static\threading-multi\src\puff.o
In file included from src\puff.cpp:74:0:
C:/libtorrent/boost_1_59_0/boost/cstdint.hpp:36:28: fatal error: boost/config.hpp: No such file or directory
compilation terminated.
HOW IS THIS POSSIBLE!?!?!

This looks like path to directory with headers is missing.
Did you set BOOST_ROOT?
When building libtorrent, the Jamfile expects the environment variable BOOST_ROOT to be set to the boost installation directory.

In order for that library to actually find boost path bjam needs to be invoked with boost=source parameter. Arvid somehow doesn't make it explicit/clear.

Related

Boost cross compilation with custom Yocto SDK fails with "No such file or directory" errors

I've been given a custom Yocto SDK so as to build a c++ app I've created and the third party libraries that the app depends on.
I've installed the SDK on a VM Ubuntu 16.04.
The first library I needed to build was boost. I use version. 1.64.
I follow the same steps I follow each time to build boost either on a Yocto SDK or a default arm compiler.
$ . /opt/environment-setup-poky-linux-gnueabi
$ ./bootstrap.sh --with-libraries=filesystem,iostreams,program_options,regex,system --prefix=/home/user/Libs
$ nano ~/user-config.jam where I place the following commands
$ using gcc : arm : /opt/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ --sysroot= /opt/sysroots/arm-poky-linux-gnueabi ;
$ ./b2 install toolset=gcc-arm link=shared threading=multi
However I always get the following error :
gcc.compile.c++ bin.v2/libs/system/build/gcc-arm/release/threading-multi/error_code.o
In file included from /opt/sysroots/arm-poky-linux-gnueabi/usr/include/gnu/stubs.h:55,
from /opt/sysroots/arm-poky-linux-gnueabi/usr/include/features.h:452,
from /opt/sysroots/arm-poky-linux-gnueabi/usr/include/c++/8.2.0/arm-poky-linux-gnueabi/bits/os_defines.h:39,
from /opt/sysroots/arm-poky-linux-gnueabi/usr/include/c++/8.2.0/arm-poky-linux-gnueabi/bits/c++config.h:508,
from /opt/sysroots/amr-poky-linux-gnueabi/usr/include/c++/8.2.0/cstddef:49,
from ./boost/config/compiler/gcc.hpp:165,
from ./boost/config.hpp:39,
from ./boost/system/config.hpp:13,
from ./boost/system/error_code.hpp:14,
from libs/system/src/error_code.cpp:16:
/opt/sysroots/arm-poky-linux-gnueabi/usr/include/gnu/stubs-32.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
# include <gnu/stubs-soft.h>
^~~~~~~~~~~~~~~~~~
I assume that the sysroot is not found correctly.
When I tried with a user-config.jam that does not contain --sysroot variable I get the error :
gcc.compile.c++ bin.v2/libs/system/build/gcc-arm/release/threading-multi/error_code.o
In file included from ./boost/config.hpp:39,
from ./boost/system/config.hpp:13,
from ./boost/system/error_code.hpp:14,
from libs/system/src/error_code.cpp:16:
./boost/config/compiler/gcc.hpp:165:10: fatal error: cstddef: No such file or directory
#include <cstddef>
^~~~~~~~~
compilation terminated.
The CC variable on the environment setup contains the follwoing:
export CC="arm-poky-linux-gnueabi-gcc -march=armv7ve -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=$SDKTARGETSYSROOT"
Is there something I can do to bypass these errors or the SDK is faulty and needs rebuilt ?
Thanks in advance

Make error: emmake make results in error when trying to build libxml2, can't find libxml.so.2

My goal is to compile my C program to wasm with emscripten (which I installed via emsdk). It uses libxml2. I am following the steps outlined here https://github.com/kripken/xml.js/blob/master/script/libxml2 to build
libxml2 from source with the appropriate emscripten parameters.
When I run emmake make, I get the following warnings and errors:
...
CCLD libxml2.la
emcc: warning: linking a library with `-shared` will emit a static object file.
This is a form of emulation to support existing build systems.
If you want to build a runtime shared library use the SIDE_MODULE setting. [-Wemcc]
emcc: warning: ignoring unsupported linker flag: `--version-script=./libxml2.syms` [-Wlinkflags]
wasm-ld: error: cannot open libxml2.so.2: No such file or directory
emcc: error: '/home/willy/emsdk/upstream/bin/wasm-ld -o .libs/libxml2.so.2.9.9 .libs/SAX.o .libs/entities.o .libs/encoding.o -L/home/willy/emsdk/upstream/emscripten/system/local/lib .libs/error.o -L/home/willy/emsdk/upstream/emscripten/system/lib .libs/parserInternals.o -L/home/willy/emsdk/upstream/emscripten/cache/wasm .libs/parser.o .libs/tree.o .libs/hash.o .libs/list.o .libs/xmlIO.o .libs/xmlmemory.o .libs/uri.o .libs/valid.o .libs/xlink.o .libs/HTMLparser.o .libs/HTMLtree.o .libs/debugXML.o .libs/xpath.o .libs/xpointer.o .libs/xinclude.o .libs/nanohttp.o .libs/nanoftp.o .libs/catalog.o .libs/globals.o .libs/threads.o .libs/c14n.o .libs/xmlstring.o .libs/buf.o .libs/xmlregexp.o .libs/xmlschemas.o .libs/xmlschemastypes.o .libs/xmlunicode.o .libs/xmlreader.o .libs/relaxng.o .libs/dict.o .libs/SAX2.o .libs/xmlwriter.o .libs/legacy.o .libs/chvalid.o .libs/pattern.o .libs/xmlsave.o .libs/xmlmodule.o .libs/schematron.o .libs/xzlib.o /home/willy/emsdk/upstream/emscripten/cache/wasm/libc.a libxml2.so.2 --relocatable -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (1)
make[2]: *** [Makefile:1065: libxml2.la] Error 1
make[2]: Leaving directory '/home/willy/CWasmSandbox/libxml2-2.9.9'
make[1]: *** [Makefile:1484: all-recursive] Error 1
make[1]: Leaving directory '/home/willy/CWasmSandbox/libxml2-2.9.9'
make: *** [Makefile:897: all] Error 2
The only thing I can gather with my limited understanding of emscripten is that it tries to access libxml2.so.2 which under normal circumstances would be generated from libxml2.la. But libxml2.so.2 was not generated because emscripten does not produce shared objects. Is this assesment correct? I tried passing the option CFLAGS="-s SIDE_MODULE=1" to make, but it didn't fix the error and was probably a stupid idea born from my limited knowledge of build systems. I also tried copying libxml2.so.2 from a previous installation into the appropriate directory, but no luck, and also kind of dumb since emscripten would have no use for .so files? What should my next steps be?
Easiest way is to resign from shared lib.
There is an important limitation with shared one (side module): it will not work if you are going to use threads in your main application.
So just make a change of ./script/libxml2
-emconfigure ../libxml2/configure --with-http=no --with-ftp=no --with-python=no --with-threads=no
+emconfigure ../libxml2/configure --with-http=no --with-ftp=no --with-python=no --with-threads=no --enable-shared=no
Build and link ./build/.libs/libxml2.a with your main application.

fatal error: openssl/ssl.h: No such file or directory

I'm coming from Python and new to C++ and am trying to test a program which retrieves data via websockets.
I copied this github repository with
git clone https://github.com/tensaix2j/binacpp
I'm trying to run the example so I filled in the api key and secret in:
/binacpp/example/example.cpp
Now from /binacpp/example folder I'm trying
make example
and I'm getting this error:
Making example
g++ -I../lib/libcurl-7.56.0/include -I../lib/jsoncpp-1.8.3/include -I../lib/libwebsockets-2.4.0/include -I../lib/libbinacpp/include \
example.cpp \
-L../lib/libcurl-7.56.0/lib \
-L../lib/libwebsockets-2.4.0/lib \
-L../lib/libbinacpp/lib \
-lcurl -ljsoncpp -lcrypto -lwebsockets -lbinacpp -o example
In file included from ../lib/libbinacpp/include/binacpp_websocket.h:16:0,
from example.cpp:8:
../lib/libwebsockets-2.4.0/include/libwebsockets.h:214:10: fatal error: openssl/ssl.h: No such file or directory
#include <openssl/ssl.h>
^~~~~~~~~~~~~~~
compilation terminated.
Makefile:25: recipe for target 'example' failed
make: *** [example] Error 1
user#ip:/opt/binacpp/example$ ^C
user#ip:/opt/binacpp/example$ ./example.run.sh
./example: error while loading shared libraries: librtmp.so.0: cannot open shared object file: No such file or directory
I'm trying to figure out why I'm getting this error and what to do with it?
1) It says on the readme that the dependencies are
jsoncpp-1.8.3
libcurl-7.56.0
libwebsockets-2.4.0
However these are included in the repository
2) if maybe it is assumed that openssl normally is already installed, how do I know which version to install? And how do I install this, because with Python you can just use pip and everything will be placed in the correct directories for including it in your program.
It looks like that the development package for openssl is not installed:
https://stackoverflow.com/a/3016986/5147260

Building 32bit version of libtorrent on osx using boost with python bindings

I'm running the following build command from the /bindings/python directory of libtorrent
./bjam boost=system link=static address-model=32 toolset=darwin architecture=x86 release
But I'm getting the following errors
/opt/local/include/boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No such file or directory
/opt/local/include/boost/python/detail/wrap_python.hpp:75:24: error: patchlevel.h: No such file or directory
/opt/local/include/boost/python/detail/wrap_python.hpp:78:2: error: #error Python 2.2 or higher is required for this version of Boost.Python.
/opt/local/include/boost/python/detail/wrap_python.hpp:142:21: error: Python.h: No such file or directory
Finally resulting in
...failed darwin.compile.c++ bin/darwin-4.2.1/release/address-model-32/architecture-x86/link-static/src/module.o..
Can anyone point to where I'm getting messed up?
The stupid question: Do you have python intalled? And if you do have it installed, but not in a standard place, you must tell bjam where to find it.
Oh, and was boost built with python support?

mysql++ examples not compiling mysql.h: No such file or directory compilation terminated

Whenever I attempt to compile some examples from the mysql++ library, I got the following error:
In file included from /home/testbed/Tools/mysql++-3.1.0/lib/cmdline.h:32:0,
from multiquery.cpp:32:
/home/testbed/Tools/mysql++-3.1.0/lib/common.h:189:20: fatal error: mysql.h:
No such file or directory
compilation terminated.
I have all the MySQL libraries installed and when I search for the mysql.h file, it is displayed!
What am I doing wrong?