Boost ¼³Ä¡

 

1. build_dest.bat ½ÇÇàÇÏ¿© bjam.exe ÆÄÀÏÀ» »ý¼ºÇÑ´Ù.

µµ½º â

F:\boost_1_38_0\tools\jam>build_dest.bat

2. bjam.exe ÆÄÀÏÀ» boostÀÇ ÃÖ»óÀ§ Æú´õ·Î º¹»çÇÑ´Ù.

µµ½º â

F:\boost_1_38_0\tools\jam\stage\bin.ntx86> copy bjam.exe ..\..\..\..\

3. bjam.exe¸¦ ½ÇÇàÇÑ´Ù.

F:\boost_1_38_0>bjam.exe --toolset=msvc stage --build-type=complete --libdir="f:\boost\lib" --includedir="f:\boost\include" --build-dir="f:\boost_work" install

¿Ï·á°¡ µÇ¸é , f:\boost Æú´õ¿¡ include, lib Æú´õ°¡ »ý¼ºµÈ´Ù.
lib Æú´õ ¾Æ·¡¿¡ lib, dll ÆÄÀÏÀÌ »ý¼º µÇ¾ú´ÂÁö È®ÀÎÇÑ´Ù.

<¶Ç´Ù¸¥ ºôµå ¿É¼Ç> Å×½ºÆ® Çغ¸Áö ¾Ê¾ÒÀ½

visual studio 6À» »ç¿ëÇÒ °æ¿ì
bjam --prefix=d:\boost "-sTOOLS=msvc" install

visual studio 2005 À» »ç¿ëÇÒ °æ¿ì
bjam --prefix=f:\boost_1_38_0 "-sTOOLS=vc-8_0" install > build_history.txt

TOOLS ¿É¼ÇÀ¸·Î´Â -msvc, -vc7, vc-8_0ÀÌ ÀÖ´Ù.

4. ºñÁÖ¾ó ½ºÆ©µð¿À ¼³Á¤

Çì´õ Æú´õ:  boost\include\boost-XXX
¿©±â¼­´Â F:\boost\include\boost-1_38·Î ÁöÁ¤Çß´Ù.

¶óÀ̺귯¸® Æú´õ: boost\lib Æú´õ ¼³Á¤
¿©±â¼­´Â F:\boost\lib·Î ÁöÁ¤

    ¿É¼Ç ¼³¸í

   --toolset      ÄÄÆÄÀÏ·¯ ÁöÁ¤
   --build-type   ºôµå ŸÀÔ ÁöÁ¤ (¡Ø Àüü ¼³Ä¡½Ã complete »ç¿ëÀ» ±ÇÀå)
   --libdir       ¶óÀ̺귯¸® ¼³Ä¡ µð·ºÅ丮
   --includedir   boost¶óÀ̺귯¸® include µð·ºÅ丮
   --build-dir    boost ¶óÀ̺귯¸® ÄÄÆÄÀÏ ÀÛ¾÷ µð·ºÅ丮

 

Çì´õÆÄÀϸ¸ »ç¿ëÇÑ´À ¿¹Á¦ÀÌ´Ù.

#include <iostream>

#include <boost/any.hpp>

 

using  namespace  std;

 

//boost::any´Â ¾î¶²ÇüÀÇ ÀÚ·áµµ º¸°ü °¡´ÉÇÏ¿©, C#ÀÇ ¹Ú½Ì/¾ð¹Ú½Ì°ú ºñ½ÁÇÏ´Ù.

//ºÎ½ºÆ® Çì´õ¸¸ ÇÊ¿äÇÔ

struct Point

{

    Point(int ix=0,int iy=0) : x(ix), y(iy) {}

    int x, y;

};

 

static char* hw = "hello world.";

 

void main()

{

    boost::any a, b;

    a = 100; // Á¤¼ö¸¦ ³Ö´Â´Ù.

    b = hw;  // ¹®ÀÚ¿­À» ³Ö´Â´Ù.

    a = b;   // anyµ¿»çÀÇ ´ëÀÔ

    b = Point(10,20); // »ç¿ëÀÚ Á¤ÀÇ Çüµµ ³Ö¾îº¸ÀÚ..

 

    cout << boost::any_cast<Point>(b).x << endl;

    if( a.type() == typeid(int) )

           cout << "intÀÔ´Ï´Ù." << endl;

    else if( a.type() == typeid(char*) )

           cout << "¹®ÀÚ¿­ÀÔ´Ï´Ù." << endl;

}

 

¶óÀ̺귯±â°¡ ÇÊ¿äÇÑ ¿¹Á¦ÀÌ´Ù.

ÀÌ»óÇÑ °Ç #pragma comment(lib, "libboost_regex-vc80-mt-sgd-1_38.lib") ¶óÀÎÀ» ÁÖ¼®Ã³¸®Çصµ º°
¹®Á¦°¡ ¾ø´Ù. ³»ºÎ¿¡¼­ ÀÚµ¿À¸·Î ÇѴ°ǰ¡.. Àß ¸ð¸£°Ú´Ù.
±×·¸´Ù°í Ãß°¡ ¶óÀ̺귯¸® Æú´õÀÎ F:\boost\libÀ» Á¦°ÅÇØ ¹ö¸®¸é ¶óÀ̺귯¸®¸¦ ãÁö ¸øÇÑ´Ù.

#include <boost/regex.hpp>

#include <iostream>

 

using namespace std;

 

#pragma comment(lib, "libboost_regex-vc80-mt-sgd-1_38.lib")

 

int main()

{

    try

    {

        const boost::regex e("([A-Z][a-z]+[A-Z][a-z]+|\\[.*\\])");

        std::string text =

            "TestCase is WikiName. but TESTCase is not WikiName! Is [this] WikiName?";

 

        boost::match_results<std::string::const_iterator> m;

        std::string::const_iterator start = text.begin();

        std::string::const_iterator end = text.end();

 

        while (boost::regex_search(start, end, m, e))

        {

            // m[0]´Â ÀÏÄ¡ÇÏ´Â ºÎºÐ ¹®ÀÚ¿­À» ³ªÅ¸³»°í,

            // m[0].first´Â ÀÏÄ¡ÇÏ´Â ºÎºÐÀÇ ½ÃÀÛ À§Ä¡,

            // m[0].second´Â ÀÏÄ¡ÇÏ´Â ºÎºÐÀÇ ³¡À» ³ªÅ¸³½´Ù.

            // m[n]Àº ÇÏÀ§ Ç¥Çö½Ä(°ýÈ£·Î µÑ·¯½ÎÀΠǥÇö½Ä)À» ³ªÅ¸³»´Âµ¥,

            // ¿¹Á¦ Á¤±Ô Ç¥Çö½Ä¿¡ ÇÏÀ§ Ç¥Çö½ÄÀÌ Á¸ÀçÇÏÁö ¾Ê±â ¶§¹®¿¡,

            // ¿©±â¼­´Â [0] ¹Û¿¡´Â ¾µ ÀÏÀÌ ¾ø´Ù.

            cout << m[0] << " = "

                << m[0].first - text.begin() << "~"

                << m[0].second - text.begin() << endl;

 

            start = m[0].second;

        }

    }

    catch (std::exception& e)

    {

        cerr << e.what() << endl;

    }

 

    return 0;

}

 

ÂüÁ¶:
    http://blog.daum.net/aswip/8429358
    ÃÖÈï¹è´ÔÀÇ ´Ù¾çÇÑ boost ¿¹Á¦µé  http://jacking75.cafe24.com/Boost/libraries.htm
    ºôµå¾øÀÌ ºÎ½ºÆ® °£´ÜÇÏ°Ô ÀνºÅç Çϱâ http://www.boostpro.com
     boost ÀÔ¹® http://mech12.springnote.com/pages/690403