Problem with gcc5 std library when building ports

Dewayne Geraghty dewaynegeraghty at
Wed Oct 26 23:01:59 UTC 2016

Have spent a couple of days trying to build around 800 ports with gcc5.
This one has me stumped!

Can anyone help regarding the apparant absence of snprintf from std?  Am I
missing something, perhaps LDCONFIG or?  I've looked in /usr/ports/Mk/ and /usr/ports/Mk/ but this is an area that I'm
unfamiliar, so nothing really stood out.

If I change the compiler from gcc5 to clang everything compiles and runs
correctly. I have in /etc/make.conf
and to use clang, I just comment out the above. So everything is constant,
on FreeBSD 10.3Stable (updated and rebuilt overnight)

For example: /usr/ports/devel/jsoncpp (but many share this problem)
g++5 -o buildscons/linux-gcc-FreeBSD/src/lib_json/json_reader.o -c -O2
-UDEBUGGING -UDEBUG -march=c3-2 -mtune=c3-2 -Wl,-rpath=/usr/local/lib/gcc5
-fno-strict-aliasing --std=c++11 -Wl,-rpath=/usr/local/lib/gcc5 -Iinclude

src/lib_json/json_reader.cpp: In member function 'std::__cxx11::string
Json::Reader::getLocationLineAndColumn(Json::Reader::Location) const':
src/lib_json/json_reader.cpp:34:18: error: 'snprintf' is not a member of
 #define snprintf std::snprintf

And for completeness:
# ldconfig -r | grep -E "gcc|\+"
        search directories:
        35:-lgcc_s.1 => /lib/
        38:-lc++.1 => /usr/lib/
        126:-lcc1.0 => /usr/local/lib/gcc5/
        127:-lgcc_s.1 => /usr/local/lib/gcc5/
        128:-lstdc++.6 => /usr/local/lib/gcc5/
        129:-lcilkrts.5 => /usr/local/lib/gcc5/
        130:-lssp.0 => /usr/local/lib/gcc5/
        131:-lquadmath.0 => /usr/local/lib/gcc5/
        132:-lgfortran.3 => /usr/local/lib/gcc5/
        133:-lobjc.4 => /usr/local/lib/gcc5/
        134:-lgomp.1 => /usr/local/lib/gcc5/
        135:-lgomp-plugin-host_nonshm.1 =>
        136:-litm.1 => /usr/local/lib/gcc5/
        137:-latomic.1 => /usr/local/lib/gcc5/

Regards, Dewayne

More information about the freebsd-ports mailing list