티스토리 툴바



#include <windows.h>

BOOL CtrlHandler(DWORD fdwCtrlType)
{
  switch(fdwCtrlType)
  {
  case CTRL_C_EVENT:
  case CTRL_CLOSE_EVENT:
  case CTRL_LOGOFF_EVENT:
  case CTRL_SHUTDOWN_EVENT:
  case CTRL_BREAK_EVENT:
  default:
    printf("종료");
  }
  return FALSE;
}

int _tmain(int argc, _TCHAR* argv[])
{
  BOOL fSuccess = SetConsoleCtrlHandler((PHANDLER_ROUTINE)CtrlHandler,TRUE);

  while(1)
  {

  }
  if(!fSuccess)
  {
    printf("종료2");
  }
  return 0;
}


자료출처 : http://perry.tistory.com/27
저작자 표시 비영리
크리에이티브 커먼즈 라이선스
Creative Commons License
Posted by ICARTSH

트랙백 주소 :: http://icartsh.tistory.com/trackback/30 관련글 쓰기

댓글을 달아 주세요


BOOST를 사용할때 보통 http://www.boostpro.com 에서 다운받아 사용하지만..
요즘 업데이트를 안하기도 하고 x86 밖에 제공하지 않아서 직접 boost를 컴파일 해야 될 필요성이 있습니다.

1. 먼저 http://www.boost.org/ 에서 최신버전의 boost다운로드한다..

2. 다운받은 파일을 압축풀고 bootstrap.bat를 실행시켜준다.. 그럼 b2.exe bjam.exe등...이 생성 된다..

3. x86버전 필요시 visual studio 명령프롬프트 x64일경우에는 x64용 명령프롬프트를 실행시킨다.

4. 아래의 명령어를 x86/x64에 맞게 실행시켜준다
32비트용
bjam --toolset=msvc-10.0 link=static runtime-link=static,shared variant=release,debug threading=multi --libdir=e:\boost\lib\ install -j4

64비트용
bjam --toolset=msvc-10.0 link=static runtime-link=static,shared variant=release,debug --architecture=x86 address-model=64 threading=multi --libdir=e:\boost\lib\x64\ install -j4 
저작자 표시 비영리
크리에이티브 커먼즈 라이선스
Creative Commons License
Posted by ICARTSH

트랙백 주소 :: http://icartsh.tistory.com/trackback/29 관련글 쓰기

댓글을 달아 주세요



1. openssl 다운로드
     http://www.openssl.org/source/  
2.  ActivePerl 설치
   
http://www.activestate.com/activeperl 
3..  전반적인 컴파일 환경 구축

    압축이 해제된 디렉토리로 이동하여, 아래와 같이 명령어를 입력합니다.

 

    1) x86 static library

        perl Configure VC-WIN32 --openssldir=C:\OpenSSL-x86 no-shared no-asm threads no-idea no-mdc2 no-rc5

 

    2) x86 static debug library

        perl Configure debug-VC-WIN32 --openssldir=C:\OpenSSL-x86-debug no-shared no-asm threads no-idea no-mdc2 no-rc5

 

    3) x64 static library

        perl Configure VC-WIN64A --openssldir=C:\OpenSSL-x64 no-shared no-asm threads no-idea no-mdc2 no-rc5

 

    4) x64 static debug library

        perl Configure debug-VC-WIN64A --openssldir=C:\OpenSSL-x64-debug no-shared no-asm threads no-idea no-mdc2 no-rc5

4. 구체적인 컴파일 환경 구축

    컴파일 환경은 다음과 같이 3가지 유형중 한 가지를 선택하여 사용이 가능합니다.

 

    1) x86

        - 어셈블리어를 사용하지 않는 경우       ms\do_ms.bat          

        - NASM 어셈블리어를 사용하는 경우    ms\do_nasm.bat    

        - MASM 어셈블리어를 사용하는 경우   ms\do_masm.bat

 

    2) x64

        - 어셈블리어를 사용하지 않는 경우     ms\do_win64a.bat

 

    3) Itanium

        - 어셈블리어를 사용하지 않는 경우 ms\do_win64i.bat 

5. 소스 수정

    윈도우 환경에서는 아래와 같은 파일을, OpenSSL을 컴파일 하기 이전에 수정해 주어야 합니다.

    (아마 다음 OpenSSL 버전에서는 필요없는 과정이 될 수도 있겠군요.. ^^;;)


    1) openssl-0.9.8k\crypto\x509v3\v3_pci.c

        소스파일 최상단에 위치한 주석문에 특수문자가 포함되어 있어서 컴파일 오류가 발생하기 때문에,

        소스파일 가장 위에 주석문을 제거하고 저장함.


    2) openssl-0.9.8k\crypto\x509v3\v3_pcia.c

        소스파일 최상단에 위치한 주석문에 특수문자가 포함되어 있어서 컴파일 오류가 발생하기 때문에,

        소스파일 가장 위에 주석문을 제거하고 저장함.

 
 6. 컴파일 및 설치

    정적 라이브러리 빌드 인 경우 : nmake -f ms\nt.mak install

    동적 라이브러리 빌드 인 경우 : nmake -f ms\ntdll.mak install

 

출처 :  http://blog.daum.net/aswip/8429385

저작자 표시 비영리
크리에이티브 커먼즈 라이선스
Creative Commons License
Posted by ICARTSH

트랙백 주소 :: http://icartsh.tistory.com/trackback/28 관련글 쓰기

댓글을 달아 주세요