You are not logged in. Please login at www.codechef.com to post your questions!

×

bits/stdc++.h does not work in mac os

0
1

why does this happen? is there a way to solve this issue.

asked 22 May '16, 11:18

gabbar1947's gravatar image

2★gabbar1947
1112
accept rate: 0%


11

bits/stdc++ is a GNU GCC extension, whereas OS X uses the clang compiler. However, you can still make it work by manually creating the header file.

Inside the directory /usr/local/include/bits (create bits), make a file called stdc++.h and paste the contents of this gist. Now it should compile as expected.

link

answered 22 May '16, 21:08

xrisk's gravatar image

3★xrisk
1212
accept rate: 0%

Follow this link.. It will help.. :)

https://stackoverflow.com/questions/28994148/how-can-i-include-bits-stdc-in-xcode

Mac OS X 10.9+ no longer uses GCC/libstdc++ but uses libc++ and Clang. After the XCode 6.0.1 update the headers are now located here:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1

To open this address follow these steps:

  1. Open Finder.
  2. Click Go on menu bar then click Go to folder or Press Command+Shift+G directly.
  3. Enter the path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1

Now, get the stdc++.h file from here,then creat bits directory in the above long address, and copy the file stdc++.h to the bits directory.

link

answered 03 Aug, 06:15

kauts_kanu's gravatar image

5★kauts_kanu
1.0k19
accept rate: 19%

edited 03 Aug, 06:20

What compiler are you using? Afaik, bits/stdc++.h is a header only found in the GNU C++ Compiler (G++).

link

answered 22 May '16, 20:08

mightymercado's gravatar image

4★mightymercado
2826
accept rate: 11%

edited 22 May '16, 20:09

I'm probably wrong about the GNU part, but the compiler question is relevant.

(22 May '16, 20:10) mightymercado4★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×3

question asked: 22 May '16, 11:18

question was seen: 8,894 times

last updated: 03 Aug, 06:20