can't compile bmdc on ubuntu 12.04

Asked by ff0255 on 2014-08-26

ubuntu 12.04 64bit
Try to compile bmdc++, it's my first experience in compiling
I installed libgtk-3-dev, libbz2-dev, libcanberra-dev, libgeoip-dev, libnotify-dev
Run scons:
---------------
pisya@ubuntu-comp3:~/bmdc++$ scons PREFIX=/usr/bin/
scons: Reading SConscript files ...
CXX env variable is not set, attempting to use g++
Mkdir("build/sconf")
Checking for g++ >= 4.1...(cached) yes
Checking for pkg-config... yes
Checking for gtk+-3.0 >= 3.00... yes
Checking for C header file time.h... yes
Checking for C header file signal.h... yes
Checking for C header file unistd.h... yes
Checking for C library pthread... yes
Checking for C library z... yes
Checking for C library bz2... yes
Checking for C library crypto... yes
Checking for C library ssl... yes
Checking for C header file iconv.h... yes
Checking for iconv(0, (const char **)0, 0, (char**)0, 0) in C library iconv... no
Checking for C header file net/if.h... yes
Checking for C library attr... no
Checking for libnotify >= 0.4.1... yes
Checking for libnotify >= 0.7... yes
Checking for libcanberra... yes
Checking for C library libminiupnpc... no
Checking for C library libnatpmp... no
Checking for C header file GeoIP.h... yes
Found GeoIP headers
Checking for C header file libtar.h... no
Dont Found libtar headers
Checking bzr revision...(cached) 443
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/release/libdcpp/ADLSearch.o -c -std=c++11 -pthread -pipe -O3 -fomit-frame-pointer -DHAVE_IFADDRS_H -DHAVE_NOTIFY -DHAVE_LIBNOTIFY_0_7 -DHAVE_GEOIPLIB -DBZR_REVISION=443 -DBZR_REVISION_STRING='"443"' -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DUSE_STACKTRACE -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DNDEBUG -DSTATICLIB -D_DATADIR='"/usr/bin/share"' -DBUILDING_DCPP -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng12 -I. -Inatpmp -Iminiupnp dcpp/ADLSearch.cpp
cc1plus: error: unrecognized command line option ‘-std=c++11’
scons: *** [build/release/libdcpp/ADLSearch.o] Error 1
scons: building terminated because of errors.
---------
What can I do to compile it?

Question information

Language:
English Edit question
Status:
Solved
For:
BMDC++ Edit question
Assignee:
No assignee Edit question
Solved by:
ff0255
Solved:
2014-08-30
Last query:
2014-08-30
Last reply:
2014-08-27
M@nk (manky) said : #1

In /SConstruct file change line #317 env.Append(CXXFLAGS = '-std=c++11') to env.Append(CXXFLAGS = '-std=c++0x') then *should fine compile but not sure.... is mainly because Ubuntu 12.04 had bit old gcc......

ff0255 (ff0255) said : #2

Thank you, that helped at that point.
Now there's another error:
-----
pisya@ubuntu-comp3:/usr/local/src/bmdc++$ scons PREFIX=/usr/local/bin/
scons: Reading SConscript files ...
CXX env variable is not set, attempting to use g++
Checking for g++ >= 4.1...(cached) yes
Checking for pkg-config... (cached) yes
Checking for gtk+-3.0 >= 3.00... (cached) yes
Checking for C header file time.h... (cached) yes
Checking for C header file signal.h... (cached) yes
Checking for C header file unistd.h... (cached) yes
Checking for C library pthread... (cached) yes
Checking for C library z... (cached) yes
Checking for C library bz2... (cached) yes
Checking for C library crypto... (cached) yes
Checking for C library ssl... (cached) yes
Checking for C header file iconv.h... (cached) yes
Checking for iconv(0, (const char **)0, 0, (char**)0, 0) in C library iconv... (cached) no
Checking for C header file net/if.h... (cached) yes
Checking for C library attr... (cached) no
Checking for libnotify >= 0.4.1... (cached) yes
Checking for libnotify >= 0.7... (cached) yes
Checking for libcanberra... (cached) yes
Checking for C library libminiupnpc... (cached) no
Checking for C library libnatpmp... (cached) no
Checking for C header file GeoIP.h... (cached) yes
Found GeoIP headers
Checking for C header file libtar.h... (cached) no
Dont Found libtar headers
Checking bzr revision...(cached) 443
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/release/libdcpp/ADLSearch.o -c -std=c++0x -pthread -pipe -O3 -fomit-frame-pointer -DHAVE_IFADDRS_H -DHAVE_NOTIFY -DHAVE_LIBNOTIFY_0_7 -DHAVE_GEOIPLIB -DBZR_REVISION=443 -DBZR_REVISION_STRING='"443"' -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DUSE_STACKTRACE -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DNDEBUG -DSTATICLIB -D_DATADIR='"/usr/local/bin/share"' -DBUILDING_DCPP -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng12 -I. -Inatpmp -Iminiupnp dcpp/ADLSearch.cpp
g++ -o build/release/libdcpp/AdcCommand.o -c -std=c++0x -pthread -pipe -O3 -fomit-frame-pointer -DHAVE_IFADDRS_H -DHAVE_NOTIFY -DHAVE_LIBNOTIFY_0_7 -DHAVE_GEOIPLIB -DBZR_REVISION=443 -DBZR_REVISION_STRING='"443"' -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DUSE_STACKTRACE -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DNDEBUG -DSTATICLIB -D_DATADIR='"/usr/local/bin/share"' -DBUILDING_DCPP -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng12 -I. -Inatpmp -Iminiupnp dcpp/AdcCommand.cpp
g++ -o build/release/libdcpp/AdcHub.o -c -std=c++0x -pthread -pipe -O3 -fomit-frame-pointer -DHAVE_IFADDRS_H -DHAVE_NOTIFY -DHAVE_LIBNOTIFY_0_7 -DHAVE_GEOIPLIB -DBZR_REVISION=443 -DBZR_REVISION_STRING='"443"' -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DUSE_STACKTRACE -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DNDEBUG -DSTATICLIB -D_DATADIR='"/usr/local/bin/share"' -DBUILDING_DCPP -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng12 -I. -Inatpmp -Iminiupnp dcpp/AdcHub.cpp
dcpp/AdcHub.cpp: In member function ‘dcpp::OnlineUser& dcpp::AdcHub::getUser(uint32_t, const dcpp::CID&)’:
dcpp/AdcHub.cpp:82:14: error: ‘dcpp::AdcHub::SIDMap’ has no member named ‘emplace’
scons: *** [build/release/libdcpp/AdcHub.o] Error 1
scons: building terminated because of errors.
-----

M@nk (manky) said : #3

as i said Ubuntu 12.04 have old tool chain ( and DC++ core officialy support only 4.8+) , i think Ubuntu 12.04 had 4.6 with incomplete c++11 support that reason is.

if know some about C/C++ you can change that lines to somethink like with insert , but do not recomdment that way.

and also last LTS of Ubuntu is 14.04, so i advise update system , then you can also install via ppa i think

ff0255 (ff0255) said : #4

Thanks, i will try to update to Ubuntu 14.04 when i have free time.