Solved Cannot compile from ports due to c++ traits error

While compiling the filesystems/encfs port in /usr/ports I stumbled accross this:
sh:
cd /usr/ports/filesystems/encfs ; make
....
In file included from /usr/include/c++/v1/__memory/allocate_at_least.h:13:
/usr/include/c++/v1/__memory/allocator_traits.h:48:29: error: no template named '__has_pointer'; did you mean 'is_pointer'?
....
This seems to come from an include file from libc++.
To investigate I tried to compile this minimalistic oneliner:
C++:
#include <memory>
which gives the same error!

Am I doing something wrong? Is my libc++ corrupt?
Any insight is appreciated.
 
What does
`find /usr/include/. /usr/local/include/. -name memory`
print?
This gives:
Code:
/usr/include/./c++/v1/experimental/memory
/usr/include/./c++/v1/memory
/usr/local/include/./absl/memory
/usr/local/include/./boost/compute/memory
/usr/local/include/./boost/thread/csbl/memory

and cc -v shows:
Code:
FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)
Target: x86_64-unknown-freebsd15.1
Thread model: posix
InstalledDir: /usr/bin
And, btw, the single line "#include <memory>" was compiled with:
c++ -g test.cpp
 
Fairly fresh install and update of 15.1p7
$cc -v
FreeBSD clang version 21.1.8 (https://github.com/llvm/llvm-project.git llvmorg-21.1.8-0-g2078da43e25a)
Target: x86_64-unknown-freebsd15.2
Thread model: posix
InstalledDir: /usr/bin

Your 19.1.7 seems off.

$ c++ -c test.cpp (your minimal test.cpp) works without errors.


Never mind. My username checks out. That was a 15.2 install. My 15.1p7 systems report clang version the same as yours (19.1.7).
$ c++ -c test.cpp still works (compiles only), though.
 
Thanks all. I've marked the post as SOLVED.

What probably happened: I goofed with a
make buildworld installworld
from an outdated /usr/src.
I recall several patchlevel update from freebsd-update nagging about non existing directories in the last year.
Thought nothing of it - but should have!
Heck, even make buildworld now fails
I'll fix it by reinstalling. Thanks again.
 
Back
Top