Develop & CS

(M1) Mac에서 <bits/stdc++.h> 사용하기

2023. 3. 24. 10:16
반응형

라이브러리 경러롤 찾는다.

여기서 usr까지만 이동한다. 그리고 usr 내에 있는 include 디렉토리로 이동한다.

 

cd /Library/Developer/CommandLineTools/usr/include

 

 

여기에 bits 디렉토리를 만든다.

sudo mkdir bits

 

bits 디렉토리로 들어가서 vi등을 사용하여 stdc++.h를 만든다.

cd bits
sudo vi stdc++.h

stdc++의 내용은 이러하다

 

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

// Copyright (C) 2003-2013 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
// <http://www.gnu.org/licenses/>.

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

// 17.4.1.2 Headers

// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
//#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

알고리즘 문제를 풀기 위한 것들이 모여있다.

다른 곳에서 찾아보고 가져왔는데 안 되는 부분이 있어서 수정을 거쳤다.

 

이렇게 stdc++.h를 만들어서 저장하고

이제 #include <bits/stdc++.h>를 사용하면 된다.

반응형
'Develop & CS' 카테고리의 다른 글
  • GCP를 이용한 웹서버 구축
그믐​
그믐​
그믐​
neutrinox4b1
그믐​
전체
오늘
어제
  • 분류 전체보기 (288)
    • Write up (Wargame) (121)
      • Pwnable (60)
      • Reversing (0)
      • Web Hacking (8)
      • Forensic (1)
      • Cryptography (6)
      • LOB (10)
      • misc (0)
      • SF pwnable 기초 (10)
      • SF pwnable 심화 (1)
      • LOS (25)
    • Security (73)
      • 시스템 해킹(PWN, System) (21)
      • 리버싱(Reverse Engineering) (1)
      • 포렌식(Forensic) (3)
      • 암호학(Cryptography) (44)
      • 네트워크(Network) (1)
      • 임베디드(Emebedded) (0)
    • Develop & CS (38)
      • Algorithm & Data Structure (6)
      • Baekjoon (11)
      • C, C++ (8)
      • Python (2)
      • R (1)
      • etc (8)
    • 프로젝트(Project) (7)
      • 시간표&급식 파싱 (1)
      • 남방진동지수 (1)
      • 네트워크 해킹 (5)
    • Daily life (44)
      • My Book (10)
      • Book Review (1)
      • IT Review (1)
      • 일상 팁 (19)
      • 네트워크관리사 (2)
      • 근황 (11)
    • 수학&과학(Mathematics & Science.. (4)

인기 글

공지사항

  • Wargame, CTF별 검색 키워드 정리
hELLO · Designed By 정상우.
그믐​
(M1) Mac에서 <bits/stdc++.h> 사용하기
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.