# Fail to build Root on OpenBSD because G\_\_Core.cxx would initialize std::string with a null value

**URL:** <https://root-forum.cern.ch/t/fail-to-build-root-on-openbsd-because-g-core-cxx-would-initialize-std-string-with-a-null-value/35426>\
**Category:** Newbie\
**Created:** [July 31, 2019, 3:48am UTC](https://root-forum.cern.ch/t/fail-to-build-root-on-openbsd-because-g-core-cxx-would-initialize-std-string-with-a-null-value/35426 "2019-07-31T03:48:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuanhtrng](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/94ad74/32.png) [@tuanhtrng](https://root-forum.cern.ch/u/tuanhtrng)\
**Post date:** [July 31, 2019, 3:48am UTC](https://root-forum.cern.ch/t/fail-to-build-root-on-openbsd-because-g-core-cxx-would-initialize-std-string-with-a-null-value/35426/1 "2019-07-31T03:48:19Z")

</div>

I fail to build ROOT 6.18 on OpenBSD 6.5 guest VirtualBox Windows 10 host.

The source is taken from GitHub, and the build configuration is gcc-4.9.4 with libcxx=on.

The compilation fails to generate G\_\_Core.cxx because std::string is being attempted to be initialized with a null value. Below is the exact error message.

```auto
terminate called after throwing an instance of 'std::logic_error'
  what(): basic_string::_S_construct null not valid

```

This is a cling stuff so I have no idea how to patch it. Can someone give me a pointer on what to do next please.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [July 31, 2019, 12:39pm UTC](https://root-forum.cern.ch/t/fail-to-build-root-on-openbsd-because-g-core-cxx-would-initialize-std-string-with-a-null-value/35426/2 "2019-07-31T12:39:43Z")

</div>

Hi, this is a very unconventional setup. BSD systems are not being actively tested, but the combination of GCC and libc++ is probably not supported even on Linux. I recommend trying to use clang if you want to build ROOT with libc++, and use GCC only with libstdc++. If you still have a problem building ROOT in that case, then you can open a bug report and we will see what we can do to fix it. @Axel can comment on that with a more definitive answer, but any platform other than Linux, Mac OS, and Windows, is no longer being tested, so they should probably be considered not supported anymore.

---

<div class="post-metadata">

**Author:** ![tuanhtrng](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/94ad74/32.png) [@tuanhtrng](https://root-forum.cern.ch/u/tuanhtrng)\
**Post date:** [August 1, 2019, 4:19am UTC](https://root-forum.cern.ch/t/fail-to-build-root-on-openbsd-because-g-core-cxx-would-initialize-std-string-with-a-null-value/35426/3 "2019-08-01T04:19:20Z")

</div>

@amadio, thanks for your reply. I found a [workaround](https://root-forum.cern.ch/t/root-on-freebsd-again/26806/8) for the error shown.

I will follow your suggestion using gcc/libstdc++ combo. Actually, I noticed the cmake configuration info mentioned disabling libcxx so I guess no harm done.
