Note that there are some explanatory texts on larger screens.

plurals
  1. POC++11 standard libraries in libstdc++ on Mac
    text
    copied!<p>In a Xcode project which I currently work on, I am using C++11 with Apple LLVM 4.2 (clang) compiler, and using libstdc++ as my standard library, because I am using a library (NTL) which was not compiled with libc++ and so I must use libstdc++.</p> <p>When writing the following code:</p> <pre><code>#include &lt;regex&gt; int main() { return 0; } </code></pre> <p>It doesn't compile, by saying:</p> <p><code>'regex' file not found</code></p> <p>And so I can't use any C++11 library with my libstdc++ (Tried <code>&lt;mutex&gt;</code>, <code>&lt;thread&gt;</code> aswell).</p> <p>Another I tried to take is to recompile <code>NTL</code> with cc and libc++, but that doesn't seem much to work. The following is some of the errors that were produced:</p> <pre><code>../include/NTL/config.h:57:5: error: expected value in expression #if ^ ../include/NTL/config.h:88:5: error: expected value in expression #if ^ ../include/NTL/config.h:95:5: error: expected value in expression #if ^ ../include/NTL/config.h:112:5: error: expected value in expression #if ^ ../include/NTL/config.h:120:5: error: expected value in expression #if ^ ../include/NTL/config.h:143:7: error: expected value in expression #elif ^ ../include/NTL/config.h:168:5: error: expected value in expression #if ^ ../include/NTL/config.h:189:5: error: expected value in expression #if ^ ../include/NTL/config.h:208:5: error: expected value in expression #if ^ ../include/NTL/config.h:226:5: error: expected value in expression #if ^ ../include/NTL/config.h:248:5: error: expected value in expression #if ^ ../include/NTL/config.h:260:5: error: expected value in expression #if ^ ../include/NTL/config.h:273:5: error: expected value in expression #if ^ ../include/NTL/config.h:289:5: error: expected value in expression #if ^ ../include/NTL/config.h:309:5: error: expected value in expression #if ^ ../include/NTL/config.h:326:7: error: expected value in expression #elif ^ In file included from FFT.c:3: In file included from ../include/NTL/FFT.h:6: In file included from ../include/NTL/ZZ.h:19: ../include/NTL/tools.h:21:10: fatal error: 'iostream.h' file not found` </code></pre> <p>It seems that the configuration header was somehow "damaged" and that libc++ doesn't have <code>&lt;iostream.h&gt;</code> and old c++ headers. And so, recompiling <code>NTL</code> was a bit of trouble for me. </p> <p>And so, how can I fix it? How can I still use libstdc++ on my project and have C++11 Libraries? If that helps, I have g++-4.8 installed with brew. Is there a way to map libstdc++ that clang uses to a new one?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload