I'm trying to find the right boost package that comes pre-compiled as well. (For Ubuntu Lucid 10.04)
I tried:
sudo apt-get install libboost-dev-all
I'm aware that most of boost is header only, but it looks like I don't have any lib files? I only got the files in /usr/include/boost/
Which package gives me the library files as well? (such as /usr/lib/boost/ or /usr/include/boost/lib/) ? Or are they already installed and I just can't find them? I would prefer to not have to compile it myself from source..
Thanks
Look in /usr/lib for files beginning with 'libboost'.
libboost-dev packages include both the libraries and the headers necessary to develop using boost. It is also split into different packages. For instance libboost-thread-dev for the boost.thread library: It depends on libboost-thread1.42-dev (on my system), and:
$ dpkg -L libboost-thread1.42-dev
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libboost-thread1.42-dev
...
/usr/lib
/usr/lib/libboost_thread.a
/usr/lib/libboost_thread.so
/usr/lib/libboost_thread-mt.so
/usr/lib/libboost_thread-mt.a
There you have the libraries.
sudo aptitude install libboost-all-dev
Related
Just installed Boost on WSL, the includes are all there but CMake fails because ${BOOST_LIBRARIES} is an empty string :(
Thus the question:
What is the location of library (.so) files after installing libboost-all-dev on WSL/Ubuntu? It's definitely not in /usr/lib nor in /usr/lib/x86_64-linux-gnu. Also /usr/local/lib is almost empty except for python distributions.
It should be in /usr/lib.
You can always see where the files are by doing
dpkg --listfiles libboost-system1.65-dev | grep .so$
On my system gives
/usr/lib/x86_64-linux-gnu/libboost_system.so
Note that libboost-all-dev is a meta-package and will nog contain libs. So see what is contained, use e.g. apt-cache depends.
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.
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.
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...
I have RHEL 5.2, with Boost 1.33 installed.
I downloaded boost_1_44_0.tar.bz2. and built it. On completion it showed:
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/home/dfe/Archive/boost_1_44_0
The following directory should be added to linker library paths:
/home/dfe/Archive/boost_1_44_0/stage/lib
How do I add the above mentioned include paths?
When I do "rpm -q boost", it shows boost-1.33.1-10.el5. Why is that so, when I've installed version 1.44?
Is there a better way to install the latest version of Boost?
There are always three steps to install software on Linux systems:
configure — "check"
make — "build software in current directory"
make install — "copy files to the systems so the other software can use this software"
You likely did the equivalent of make but did not do the equivalent of make install. You need to run
sudo ./b2 install
after running ./b2
Just add the paths to your .bashrc or .profile (or whatever floats your boat) like this:
export LIBS="-L/home/dfe/Archive/boost_1_44_0/stage/lib"
export CPPFLAGS="-I/home/dfe/Archive/boost_1_44_0"
You have to include these directories into makefile which you would use to build your application
CC -I/home/dfe/Archive/boost_1_44_0 -L/home/dfe/Archive/boost_1_44_0/stage/lib yourprogram.cpp
-I option Adds dir to the list of directories that are searched for #include files.
-L option adds dir to the list of directories searched for libraries by linker
CC is sun compiler...
First, I removed the existing boost rpm using
rpm -e boost-1.33.1-10.el5
A message is displayed saying "error: "boost" specifies multiple packages"
Then tried:
rpm -e --allmatches boost
(I don't remember whether I typed 'boost' or 'boost-1.33.1-10.el5')
The packages with dependencies were shown.
I did:
rpm -e [packagename1]
rpm -e [packagename2]
and so on and then did:
rpm -e --allmatches
This erased boost completely from my system.
Then I extracted boost_1_44_0.tar.bz2 using tar -xvjf boost_1_44_0.tar.bz2 and ran bootstrap with:
./bootstrap.sh
Then ran bjam as:
./bjam install
That's it! Boost got installed on my system, and I didn't have to specify any of the linker options while compiling programs! Yay!
Now the 'rpm -q boost' command shows that there is no package installed.