install xmlrpc for c++ in /usr/local/lib - c++

I want to use xml-rpc for C and C++ in a project. I was able to configure and make (build) the project correctly, however, i need the library to be installed in /usr/local/lib , /usr/local/include . When i run make install the library will be installed in /usr/lib , /usr/include.
Can anybody help, i.e. explain how to install the library in the other directory.
kind regards

you need to build it with : ./configure --prefix=/usr/local/ && make && make install.
Anyway, the best solution is probably to install it via the package manager of the distribution you are using.

Related

Difference between libzmq and cppzmq , and between zmq.h and zmq.hpp?

For installation of ZeroMQ on Linux-Ubuntu , one website
https://tuananh.org/2015/06/16/how-to-install-zeromq-on-ubuntu/
says to run following commands :
sudo apt-get install libtool pkg-config build-essential autoconf automake
sudo apt-get install libzmq-dev
in which we are installing libzmq-dev seperately.
Whereas according to
http://zeromq.org/intro:get-the-software
"Make sure that libtool, pkg-config, build-essential, autoconf, and automake are installed."
So we dont need to install libzmq-dev explicity.
So my question is what difference does it make? what is the use of libzmq? Is it different from libzmq-dev ? If I want to code in C++ , then do I need to install both libzmq and cppzmq ,as given in https://github.com/zeromq/cppzmq .
And please tell which header file( zmq.h ,zmq.hpp and zhelpers.hpp ) comes from which library?
libzmq contains the zmq library only (libzmq.so, libzmq.a).
libzmq-dev contains the library and also C header file (zmq.h). If you want to develop with zmq, you need to use this one instead of libzmq.
"Make sure that libtool, pkg-config, build-essential, autoconf, and automake are installed." So we dont need to install libzmq-dev explicity.
These tools are needed if you want to build libzmq from source code. No need to do that if you install via apt.
cppzmq is C++ binding for zmq so you can use C++ stuffs to work with ZMQ instead via C api that libzmq provide.
zmq.h from libzmq-dev, zmq.hpp and zhelpers.hpp from cppzmq.

iwlib.h: No such file or directory

This is the first time for me to use Linux and its development tools. When I was trying to build the project I have to read, I had an error:
/home/charlie/AODV/llf.c:36: error: iwlib.h: No such file or directory
I was building the project with Qt. Beforehand, I installed libnl by make and make install, but the problem was not resolved. I am wondering if I did not install libel correctly or there are something more I have to do.
Welcome to Linux development.
You need to install libiw and it's development header(s).
How to do this is distribution dependant. On my Debian (should be more or less the same on any Debian based distro like Ubuntu):
jbm#sumo:~$ apt-cache search libiw
libiw-dev - Wireless tools - development files
libiw30 - Wireless tools - library
libiw30 is the binary lib, and the *-dev package is for it's header file(s), plus sometimes some docs (man pages etc). So:
jbm#sumo:~$ sudo apt-get install libiw-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
[...]
The following additional packages will be installed:
libiw30
The following NEW packages will be installed:
libiw-dev libiw30
Note how installing the header(s) for a lib rightfully install the library as well.
After install:
jbm#sumo:~$ find /usr/include/ -name iwlib.h
/usr/include/iwlib.h
jbm#sumo:~$ find /usr/lib -name "libiw*"
/usr/lib/x86_64-linux-gnu/libiw.so
/usr/lib/x86_64-linux-gnu/libiw.a
Note that:
/usr/include is part of the standard search path for headers of your
gcc toolchain, so you don't need to add a peculiar -I (for "include")
option.
/usr/lib is the same for lib binaries, so no need any -l or
-L (for "link") option.
You need to say to the compiler where to look for the header file. Use the -Idir option with dir the directory where the header file is.

Including and excluding qt modules and addons while configuring Qt5.5.1

Can someone explain what is a correct way to include some modules and addons while doing ./configure in Qt5.5.1?
I should have a x11 addon installed and tried that with:
./configure -qt-x11
./configure -qt-x11extrass
but it doesn't work.
I am reading this for configure options, but I figured out that many things you have to guess how they need to be done. I am building qt5.5.1 on Ubuntu 14.04.3 to cross-compile for BBB.
If you want to build some module (all module dependency packages must be installed first), you need to go to module directory (for example qtmultimedia in qt directory) and run qmake (built for your specific architecture), after that make and sudo make install. Now you will be able to include required module into your .pro file.

why can't I to install boost in /usr/include?

I'm trying to install boost into include directory for avoid -I flag use in each g++ compiler call,I installed using this command line: ./bjam --prefix=/usr/include install
see --prefix value, it install in /home/myusername, why?
Thanks in advance.
You would need root permissions to install in /usr/include.
Actually your system has done you a favor by not letting you do that. The --prefix option says where to install everything -- headers, libraries, executables, documentation, etc. For example, the header files would be installed in /usr/include/include, which is not going to be in your compiler's search path.
Disclaimer:: This assume that ./bjam --prefix=... behaves similarly to ./configure --prefix=.... I haven't actually used bjam. If bjam's --prefix option means something else, please correct me.
Depending on your system, you may be able to install Boost from a repository rather than building it from source. For Debian or Ubuntu, for example, something like sudo apt-get install libboost might work.
Note that I said something like that; it appears that Boost consists of a number of packages; apt-cache search boost, or better yet, do a Google search to see how to install Boost on your particular system.
Try running
sudo ./bjam
Doing this should run bjam with appropriate privileges to install to /usr/local/include and /usr/local/lib, both of which should be in your search path...

Build Boost on Mac with Xcode

I've recently got acquainted with Boost library and I'd like to use it in my Xcode project. But sadly there is no HowTo or FAQ on how to do it :(
What's the sequence of actions to build and use Boost libraries in Xcode?
The easiest way I've found to do it is to install MacPorts, then you can install/build Boost via a single command:
sudo port install boost
Plus you get similar access to other open source software. The only downside I've found is that, like any other package management system, they are not always up to date with the latest version.
If you prefer Homebrew as your package manager, the command is:
brew install boost
I don't know how to use Boost from XCode (I'm not a Mac programmer), but building boost is usually done through their own build tool, bjam.
They have a guide to building boost here, and you can download the latest version of bjam here
Once it is built, you reference it from Xcode the same way you would any other library. The boost/include should be added to your include path, and the libraries in boost/lib can be referenced for the boost libs that require it.
To build boost on a mac, follow the unix variants getting started page (http://www.boost.org/doc/libs/1_39_0/more/getting_started/unix-variants.html). You won't use Xcode directly to perform the build, but once complete you can add the boost include paths and dylib's to your Xcode project.
I found that to build Boost 1.41.1 on MacOS, you need to do the following:
Download boost 1.46.1 from here: http://sourceforge.net/projects/boost/files/boost/1.46.1/
Unpack the file
Open terminal, cd to the install directory, and do the following:
chmod u+x configure.sh
cd tools/build/v2/engine/src
chmod u+x build.sh
Then go back to the install directory, and:
./configure.sh
If that runs successfully, it will tell you to run:
./bjam
That's it.. for whatever reason, I needed to set those permissions manually before it would work.
su - root
enter root password and then run below as root
/opt/local/bin/port install boost
If you have never logged in as root or forgotten your password, here are the steps to reset root password
http://support.apple.com/kb/HT1528?viewlocale=en_US&locale=en_US
For most of the boost libraries, there's nothing to build, it's all in header files.
The remainder of the instructions are here.
Currently I'm very happy with using Pete Goodliffe's script which builds a framework from the Boost source package for both iOS and Mac. Drag and drop it into a project and it works!
There are multiple versions of the script out there. Here's one:
https://gist.github.com/faithfracture/c629ae4c7168216a9856/61be257e1c0839c85743777d0687becad9913bf7
Elaboration of Ferrucio's answer:
Install Boost using MacPorts (sudo port install boost) or Homebrew (brew install boost).
Find the path to the Boost header files (it should be in /opt/homebrew/include if you're using Homebrew).
Add the path to System Header Search Paths in the Build Settings of your Xcode target.
IMPORTANT NOTE: If you add the path to User Header Search Paths instead of System Header Search Paths, as other users suggested, then your code will fail to build, since the Boost files use angled-includes (#include <boost/filename.hpp>) to include each other. Angled-includes are only for including system library headers, and thus they only work if Boost is in the System Header Search Paths.
You can read about the difference between angled-includes and quoted-includes here.