Build error: Undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
Build error: Undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
Problem
When compiling on Linux with MariaDB the following error might happen:
Linking CXX executable bnetserver
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libmariadbclient_r.a(client_plugin.c.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [src/server/bnetserver/bnetserver] Error 1
make[1]: *** [src/server/bnetserver/CMakeFiles/bnetserver.dir/all] Error 2
make: *** [all] Error 2
Solution
The package libmysql++-dev
installs MariaDB instead of MySQL (problem confirmed in Ubuntu 14.04).
sudo apt-get remove libmysql++-dev
sudo apt-get remove mariadb-common
- Install
libmysqlclient-dev
- Download package from: http://packages.ubuntu.com/trusty/libmysqlclient-dev
- Install it (e.g
sudo dpkg -i libmysqlclient-dev_5.5.40-0ubuntu0.14.04.1_amd64.deb)
- Install
libmysql++-dev
- Download package from: http://packages.ubuntu.com/trusty/devel/libmysql++-dev
- Install it (e.g
sudo dpkg -i libmysql++-dev_3.2.0+pristine-1_amd64.deb.deb)
Related content
Build error: LNK2019 unresolved external symbol _mysql...
Build error: LNK2019 unresolved external symbol _mysql...
More like this
Build error: Internal compiler error (QuestDef.h) <deprecated>
Build error: Internal compiler error (QuestDef.h) <deprecated>
More like this
Missing DBC: gtNpcTotalHp.dbc, ... <deprecated>
Missing DBC: gtNpcTotalHp.dbc, ... <deprecated>
More like this
dyld: Library not loaded: libmysqlclient.XX.dylib
dyld: Library not loaded: libmysqlclient.XX.dylib
More like this
Application Error: 0xc000007b
Application Error: 0xc000007b
More like this
CMake error: Boost not found
CMake error: Boost not found
More like this