Mac 终端怎么使用“bits/stdc++.h”头文件

我前面的文章写到Xcode怎么用“bits/stdc++.h”头文件https://blog.csdn.net/u013241595/article/details/99412978,但是这个只能Xcode用,在终端用不了,下面说一下在终端怎么用“bits/stdc++.h”头文件

找到Macintosh HD这个磁盘

Mac 终端怎么使用“bits/stdc++.h”头文件_第1张图片

进去点资源库

Mac 终端怎么使用“bits/stdc++.h”头文件_第2张图片

找到Developer点进去

找到CommandLineTools点进去

Mac 终端怎么使用“bits/stdc++.h”头文件_第3张图片

找到usr点进去

Mac 终端怎么使用“bits/stdc++.h”头文件_第4张图片

找到include点进去

Mac 终端怎么使用“bits/stdc++.h”头文件_第5张图片

在里面新建一个bits文件夹,然后进入这个文件夹

Mac 终端怎么使用“bits/stdc++.h”头文件_第6张图片

在里面新建一个stdc++.h文件

Mac 终端怎么使用“bits/stdc++.h”头文件_第7张图片

最后将下面内容复制到这个文件中,然后保存就好了

// C++ includes used for precompiling -*- C++ -*-

// Copyright (C) 2003-2014 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// .

/** @file stdc++.h
 *  This is an implementation file for a precompiled header.
 */

// 17.4.1.2 Headers

// C
#ifndef _GLIBCXX_NO_ASSERT
#include 
#endif
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#if __cplusplus >= 201103L
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#endif

// C++
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#if __cplusplus >= 201103L
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#endif

现在大功告成可以打开终端试一下头文件是不是可以正常使用了

 

 

 

 

 

 

 

 

你可能感兴趣的:(c++,Mac10.15,Mac终端)