카테고리 없음

Code Blocks For Macos High Sierra

dextressicol1981 2021. 2. 28. 11:57


Boost is a set of libraries for the C++ programming language that provide support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains over eighty individual libraries.[2]

STEP 1: Download macOS High Sierra The full operating system is a free download for anyone who has purchased Mac OS X Snow Leopard, Lion, or Mountain Lion or has a Mac preloaded with OS X Mavericks, Yosemite, El Capitan, or macOS Sierra. MacOS Big Sur; macOS Catalina; macOS Mojave; macOS High Sierra; macOS Sierra; OS X El Capitan; OS X Yosemite; OS X Mavericks; OS X Mountain Lion; Mac OS X v10.7 Lion; Mac OS X v10.6 Snow Leopard; Mac OS X v10.5 Leopard; Mac OS X v10.4 Tiger; Mac OS X v10.3 and earlier; Mac OS X Technologies; Classic Mac OS (OS9, OS8 & System 7) Photos for Mac.

Code Blocks For Macos High Sierra

The other interesting points of Boost are :

Code
  1. Open source
  2. Cross platform
  3. Complement to STL rather than a replacement
  4. Many of Boost developers are on the C++ standard committee
  5. Well documented
  6. Most of the Boost libraries are licensed under the Boost Software License, designed to allow Boost to be used with both free and proprietary software projects

Installation Boost

Sierra

Before jumping into steps of configuring Boost on various IDE, let’s begin with Boost installation. To be noted that on this post I run Xcode on OS X, Code::Blocks on Linux (Ubuntu) and Visual Studio on Windows. The detail environments I use are :

  1. OS X 10.11.4 El Capitan
  2. Ubuntu 14.04.4 LTS
  3. Xcode Version 7.2
  4. Code::Blocks 13.12, gcc 4.8.4
  5. Visual Studio 2013
  6. Boost 1.60.0

OS X and Linux (Ubuntu)

There are several ways of Boost installation. Instead of build from source code, we can use package manager such as MacPorts, Homebrew, Advance Package Tool, etc. In this post we will build Boost from source code. The installation steps (from source code) on OS X and Ubuntu are the similar. To make it consistent, I use the same installation path for OS X and Ubuntu that is /usr/local/boost_1_60_0. You can use different path if you want. The steps are :

  1. Download boost library from Boost website
  2. Extract it.
  3. Open terminal, navigate to the extracted directory
  4. Create directory on /usr/local/boost_1_60_0, and ensure IDE has access to the directory. On my case I don't need this step on OS X, but on ubuntu it does.
  5. Run command :This last step quite take time. So you can have coffee while waiting for it :)

Once the installation finish, we should have generated directory. They are /usr/local/boost_1_60_0/include contains header files and /usr/local/boost_1_60_0/lib contains libraries.

Macos

Windows

Download Mac Os High Sierra

The Boost installation step on Windows is also similar to the installation step on OS X and Ubuntu.The steps are :

  1. Download boost library from Boost website
  2. Extract it to C:boost_1_60_0
  3. Open Visual Studio command prompt. I use Visual Studio 2013 x86 Native Tools Command Prompt native tool (I have not test using default Windows Command Prompt)As on OS X and Ubuntu, the last step quite take time.

Code Blocks For Macos High Sierra 10.13

Configure Boost on IDE(s)

High

Download Os Sierra For Mac

Before create C++ projects on various IDE, let’s create a simple C++ hello world code that use Boost libraries. To simplify the test, I grab sample code from here

The snipped code above just print text and write it to a text file. We just want to ensure the IDE’s compiler can compile and build the code that includes Boost libraries.

  • Xcode

    To include Boost libraries on Xcode project :
    1. Select Xcode project > Build Setting
    2. Add /usr/local/boost_1_60_0/include/ to the Header Search Paths
    3. Add /usr/local/boost_1_60_0/lib/ to the Library Search Paths
  • Code::Blocks

    To include Boost libraries on Code::Blocks project :
    1. Right Click on Code::Blocks project > Build Option
    2. Select Compiler tab, add /usr/local/boost_1_60_0/include/
    3. Select Linker tab, add /usr/local/boost_1_60_0/lib/
  • Visual Studio

    To include Boost libraries on Visual C++ project :
    1. Right Click on VC++ project > Properties
    2. Select VC++ Directories on the left pane
    3. Add C:boost_1_60_0 on Include Directories item
    4. Add C:boost_1_60_0stagelib on Include Directories item
    5. Click OK to close the dialog

The last is rebuild the above code on selected IDE. We should not got any errors once the IDE can detect the Boost directory path.

The sample of this article can be downloaded here

High Sierra Os Mac

Reference