# Inconsistency in /usr/include/c++ same version of c++ different releases



## comarius (Sep 18, 2019)

How these builds are being generated ? Is this only for ARM ?

Last days I tried to enable some pins in BBB ARM builds. I ran out of options with

```
FreeBSD generic 13.0-CURRENT FreeBSD 13.0-CURRENT r351363 GENERIC  arm
```
Then I start downgrading, installing back builds. I end up using.

```
FreeBSD beaglebone 11.3-RELEASE FreeBSD 11.3-RELEASE #0 r349754: Fri Jul  5 03:41:31 UTC 2019     root@releng2.nyi.freebsd.org:/usr/obj/arm.armv6/usr/src/sys/BEAGLEBONE  arm
```

Before downgrading I built my application (C++) and everything built OK ( ver 13.0).
Now using ver 11 from 2018 I cannot build the c++ app. I get std++ errors. Tough the (g++) c++ versions are 8.0.X on both systems.
The /usr/include/c++/ on both versions shows


```
[marius@beaglebone /usr/include/c++]$ ls -l
total 8
drwxr-xr-x  7 root  wheel   512 Jul  5 03:41 4.2
drwxr-xr-x  5 root  wheel  3072 Jul  5 03:42 v1
[marius@beaglebone /usr/include/c++]$ uname -a
FreeBSD beaglebone 11.3-RELEASE FreeBSD 11.3-RELEASE #0 r349754: Fri Jul  5 03:41:31 UTC 2019     root@releng2.nyi.freebsd.org:/usr/obj/arm.armv6/usr/src/sys/BEAGLEBONE  arm
[marius@beaglebone /usr/include/c++]$


[root@generic /usr/include/c++]# ls -l
total 8
drwxr-xr-x  7 root  wheel   512 Aug 22 03:48 4.2
drwxr-xr-x  5 root  wheel  3072 Aug 22 03:49 v1
[root@generic /usr/include/c++]# uname -a
FreeBSD generic 13.0-CURRENT FreeBSD 13.0-CURRENT r351363 GENERIC  arm
[root@generic /usr/include/c++]#
```

Though on a closer look the files differ.


```
[marius@beaglebone ~/cpp13/include]$ diff -rq ./c++/ /usr/include/c++
Files ./c++/v1/__errc and /usr/include/c++/v1/__errc differ
Files ./c++/v1/__threading_support and /usr/include/c++/v1/__threading_support differ
Files ./c++/v1/cctype and /usr/include/c++/v1/cctype differ
Files ./c++/v1/errno.h and /usr/include/c++/v1/errno.h differ
Files ./c++/v1/mutex and /usr/include/c++/v1/mutex differ
Files ./c++/v1/thread and /usr/include/c++/v1/thread differ
Files ./c++/v1/tr1/__errc and /usr/include/c++/v1/tr1/__errc differ
Files ./c++/v1/tr1/__threading_support and /usr/include/c++/v1/tr1/__threading_support differ
Files ./c++/v1/tr1/cctype and /usr/include/c++/v1/tr1/cctype differ
Files ./c++/v1/tr1/errno.h and /usr/include/c++/v1/tr1/errno.h differ
Files ./c++/v1/tr1/mutex and /usr/include/c++/v1/tr1/mutex differ
Files ./c++/v1/tr1/thread and /usr/include/c++/v1/tr1/thread differ
```

Exactly

```
In file included from /usr/include/c++/v1/sstream:174:
In file included from /usr/include/c++/v1/ostream:138:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:18:
In file included from /usr/include/c++/v1/mutex:191:
In file included from /usr/include/c++/v1/__mutex_base:15:
In file included from /usr/include/c++/v1/chrono:798:
/usr/include/c++/v1/ctime:66:9: error: no member named 'difftime' in the global namespace
using ::difftime;
      ~~^
/usr/include/c++/v1/ctime:67:9: error: no member named 'mktime' in the global namespace; did you mean 'mktemp'?
using ::mktime;
      ~~^
/usr/include/stdlib.h:215:7: note: 'mktemp' declared here
char    *mktemp(char *);
         ^
In file included from /usr/include/c++/v1/sstream:174:
In file included from /usr/include/c++/v1/ostream:138:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:18:
In file included from /usr/include/c++/v1/mutex:191:
In file included from /usr/include/c++/v1/__mutex_base:15:
In file included from /usr/include/c++/v1/chrono:798:
/usr/include/c++/v1/ctime:68:9: error: no member named 'time' in the global namespace
using ::time;
      ~~^
/usr/include/c++/v1/ctime:70:9: error: no member named 'asctime' in the global namespace; did you mean 'adjtime'?
using ::asctime;
      ~~^
/usr/include/sys/time.h:529:5: note: 'adjtime' declared here
int     adjtime(const struct timeval *, struct timeval *);
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:18:
In file included from /usr/include/c++/v1/mutex:191:
In file included from /usr/include/c++/v1/__mutex_base:15:
In file included from /usr/include/c++/v1/chrono:798:
/usr/include/c++/v1/ctime:71:9: error: no member named 'ctime' in the global namespace
using ::ctime;
      ~~^
/usr/include/c++/v1/ctime:72:9: error: no member named 'gmtime' in the global namespace
using ::gmtime;
      ~~^
/usr/include/c++/v1/ctime:73:9: error: no member named 'localtime' in the global namespace
using ::localtime;
      ~~^
/usr/include/c++/v1/ctime:75:9: error: no member named 'strftime' in the global namespace
using ::strftime;
      ~~^
```
where I am getting the c++ compiler errors


----------



## SirDice (Sep 18, 2019)

When you do a source upgrade/update make sure to also run `make -C /usr/src delete-old` and `make -C /usr/src delete-old-libs` to remove old stuff (set BATCH_DELETE_OLD_FILES to automate it).


----------

