검색결과 리스트
makefile에 해당되는 글 2건
- 2014.01.29 clang에서 boost 라이브러리 사용하기
- 2013.09.04 Ubuntu에서 Boost 라이브러리 빌드 테스트 해 보기
소스 코드: hello-boost.cpp
#include <boost/regex.hpp>
#include <iostream>
#include <string>
int main()
{
std::string line;
boost::regex pat("^Subject: (Re: |Aw:)*(.*)");
while(std::cin)
{
std::getline(std::cin, line);
boost::smatch matches;
if(boost::regex_match(line, matches, pat))
std::cout << matches[2] << std::endl;
}
return 0;
}
Makefile
CXX=clang++
CXXFLAGS=-I/home/dev/Dev/C++/boost
LDFLAGS=-L/home/dev/Dev/C++/boost/stage/lib
LDLIBS=-lboost_regex
all:hello-boost
clean:
rm -rf hello-boost
rm -rf *.o
Boost 라이브러리는 home에서 아래의 디렉토리에 설치
Boost 라이브러리를 빌드하여 debug, release 각각 만든다(정적 라이브러리)
빌드 방법은 다음 http://jacking.tistory.com/1070
tesp.cpp와 Makefile을 TestCppBoost 디렉토리에 생성
소스코드
Makefile
빌드 후 실행
댓글