Tag Archives: error adding symbols: DSO missing from command line

[Solved] PHP Compile error: error adding symbols: DSO missing from command line

PHP compilation: error adding symbols: DSO missing from command line

After half a day’s struggle, the solution is as follows:

1. ./configure –disable-shared –enable-static

2. make& make test

3. make install

Tips for compiling and installing PHP 7.4 in CentOS 7

Generally, install EPEL and then install:

yum install -y epel-release
yum install -y oniguruma oniguruma-devel

If not, install/update EPEL manually:

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum install -y https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
yum install -y oniguruma oniguruma-devel

Or:

CentOS 7 can be installed directly by executing the following commands:

yum -y install https://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-6.9.6-1.el7.remi.x86_64.rpm
yum -y install https://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-devel-6.9.6-1.el7.remi.x86_64.rpm

Or:

yum remove epel-release #If a conflict is reported, remove the conflicting package first
rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y oniguruma oniguruma-devel
yum clean all && yum makecache
yum repolist all #Check epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 is or not disabled

How to compile boost into a separate so file
https://github.com/ulfjack/ryu/issues/111
https://www.boost.org/doc/libs/1_77_0/doc/html/boost_asio/using.html#boost_asio.using.optional_separate_compilation

error adding symbols: DSO missing from command line

What are the eight life cycle hook functions of Vue>>>

Recently, when I was working on the project, I encountered a lot of thorny problems when compiling the code, and the information on the Internet was relatively small. On the issue of appeal, I just want to say look

DSO missing from command line: Causes and solutions. Only after reading the introduction of this article can I have a better understanding of this error

In other words, if Library B relies on library a for static compilation, then Library B will have the link information of Library A. let’s talk about the error

$ g++ main.cpp -lA -lB -o main  

Will output

/usr/bin/ld: /usr/local/lib/libB.a(main.cpp.o): undefined reference to symbol '_a_symbol_name'
/usr/local/lib/libA.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

At that time, the blogger said that in binutils & lt; There was no problem on 2.22, but there was a problem later

This should be a compilation problem. LD automatically recursively parses the linked lib. When library a is loaded, everything is normal. However, when Library B is loaded, LD automatically parses its static links, so it repeats, causing error adding symbols. So there’s no problem with the next one

$ g++ main.cpp -lB -lA -o main  

In this way, the compilation is normal and the program can run normally

As for the sequence of link libraries, I have read the article about the sequence of link libraries. Normally, when a link dynamically connects to a library, it starts from left to right. If there is a sequence error, GCC will help us to relocate it automatically. I think the way to ensure it is to do a good job in the sequence of the library

I’ll sort out the link order here

high level static link library

underlying dependency Library

high level dynamic link library

other unrelated Libraries

….fuck,fuck! Rewriting twice, the first power can understand, the second inexplicably turned off the computer, come on, we are civilized people, this is just a small episode, we continue