/usr/bin/ld: cannot find -lboost_system - c++

Getting error:
/usr/bin/ld: cannot find -lboost_system
collect2: ld returned 1 exit status
I already ran ldconfig and checked with ldconfig -v:
libboost_system.so.5 -> libboost_system.so.5
I used find to get the location of the library:
/usr/lib/libboost_system-mt.so.5
/usr/lib/libboost_system.so.5
Here is part of the command:
-Wl,-gc-sections -L/usr/lib -lboost_system -Wl,--end-group
Honestly do not know what is causing the problem. Tried everything. Any help is necessary

(Answered in a comment. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
The libs are actually in boost_1_55_0/stage/lib. So its -L/root/boost_1_55_0/stage/lib and I had to add that directory to /etc/ld.conf.d/libs.conf and ran ldconfig with it.
#Drax noted:
Only if you do not install boost. or Install it in a custom directory

Related

How can I install the "sub" library for g++ compilation for Festvox?

I'm trying to configure and make festvox, but when I attempt making it, g++ shows errors with things such as -fpermissive and how it cannot locate the library "sub". How can I get the library?
Here is a part of the logs:
making in src/vc/src/analysis ...
g++ -o analysis main.o analysis_sub.o -L../lib -lsub -lsp
/usr/bin/ld: cannot find -lsub
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:65: analysis] Error 1
making in src/vc/src/extdim ...
g++ -o extdim main.o -L../lib -lsub -lsp
/usr/bin/ld: cannot find -lsub
I have already tried using apt-get to see if the library resides in the repo, but I can't be sure that any of them actually stop the issue.
I instead got Festival through apt. I felt at first that it would outdated, but it seems to be as up to date on there as on the website.
sudo apt install festival

Cygwin: Error while linking .lib files

I'm new with Cygwin and currently I'm trying to build a little project which would encrypt some files.
The problem I'm having is that when I try to build the .cpp with the command:
gcc test.cpp -I /cygdrive/c/OpenSSL-Win32/include/ -L/cygdrive/c/OpenSSL-Win32/lib/MinGW -lcrypto -lssl
(OpenSSL is installed at cygdrive/c/OpenSSL-Win32) I get the error:
/usr/lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld: cannot find -lcrypto
/usr/lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld: cannot find -lssl
collect2: error: ld returned 1 exit status
I can't understand why It can't to find the libraries, because I clearly have libssl.lib and libcrypto.lib there. Sorry if my question sounds silly I'm with all this. Thanks.

Boost and ssl client server building issue on Linux

I have installed boost as a third library when I install pcl (Point Cloud Library).
Now I am trying to run client and server programs http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/example/cpp03/ssl/client.cpp
When trying to link the required libraries:
g++ -I /usr/include/boost/ server.cpp -o server -lboost_system -lssl -lpthread
following error appears:
/usr/bin/ld: /tmp/ccRbD849.o: undefined reference to symbol
'ERR_reason_error_string##OPENSSL_1.0.0'
//lib/x86_64-linux-gnu/libcrypto.so.1.0.0: error adding symbols: DSO
missing from command line collect2: error: ld returned 1 exit status
When I searched the usr folder the Boost folder exists only inside include subfolder.
What can I do to solve this problem.
[...] libcrypto.so: [...] DSO missing from command line
spells it out! You are missing
-lcrypto
on the linker command line. In fact I always use -lssl -lcrypto in tandem

How can I compile a C++ program with root library includes using g++?

I have written a C++ program (mainPixelDet1.C that uses a class defined in PixelDet1.C), that works in root's interactive mode.
But now I want to compile it outside root, using g++.
Here's what I write on the Terminal:
g++ -o main mainPixelDet1.C PixelDet1.C `root-config --cflags --glibs`
And here's what I get:
/usr/bin/ld: cannot find -lGraf3d
usr/bin/ld: cannot find -lPostscript
/usr/bin/ld: cannot find -lPhysics
collect2: error: ld returned 1 exit status
You'll have to also include --ldflags to root-config, so that root-config will supply the necessary library flag arguments.
I had the same problem and I just solved it installing these libraries: "libroot-*", "root-plugin-*","ttf-root-installer".`
I find the answer on ROOT forum if you interested, here is the link:
https://root.cern.ch/phpBB3/viewtopic.php?t=16352.
To install the library, you can write on terminal the follow command line:
sudo apt-get install nameoflibrary

compiling boost.asio using g++ compiler

I'm new to g++ compiler and also trying to start coding with boost.asio libraries, but have some difficulties compiling the code using g++.
I have installed boost libraries usingsudo apt-get install libboost-all-dev and boost folder is located in /usr/include directory, and whole scenario:
geek#ubuntu:~/workspace/HelloBoost/src$ g++ -I /usr/include/ -l boost_asio HelloBoost.cpp
/usr/bin/ld: cannot find -lboost_asio
collect2: ld returned 1 exit status
Thanks for your answers.
Did you read about using boost.asio ? Apparently, it looks like a headers only library, and you only need to link -lboost_system -lboost_regex -lopenssl