본문 바로가기
IT/c_cpp

오픈소스 빌드하기 ( OpenSSL )

by 가능성1g 2024. 8. 21.
반응형

1. 소스 다운로드

Downloads | Library (openssl-library.org)

 

Downloads

The master sources are maintained in our git repository, which is accessible over the network and cloned on GitHub, at https://github.com/openssl/openssl. Bugs and pull patches (issues and pull requests) should be filed on the GitHub repo. Please familiari

openssl-library.org

현재 기준 3.3.1 최신으로 다운로드 함

 

2. 압축해제 및 컴파일 방법 확인

파일내 INSTALL.md 파일에 컴파일 방법에 대해서 자세히 나와있다!!

 

3. 펄 설치 ( Strawberry Perl ) 

Strawberry Perl for Windows

 

Strawberry Perl for Windows

Perl is a programming language suitable for writing simple scripts as well as complex applications — see https://www.perl.org. Strawberry Perl is a perl environment for MS Windows containing all you need to run and develop perl applications. It is design

strawberryperl.com

현재 기준 버전 : 5.40.0.1 (2024-08-10)

 

4. Visual Studio 설치 ( Visual Studio 2022 Community 설치함 - C++ 데스크탑 옵션 추가함 )

 

5. 컴파일 실행

perl Configure

 

nmake 를 실행하기 위해, Visual Studio 설치하면 실행할 수 있는 x64 Natvie Tools Command Prompt For VS2022

를 실행 해서 해당 창에서 소스코드 폴더로 이동후, 아래 커맨드 실행

nmake

 

컴파일 산출물 확인 ( lib, dll )

 

위의 프롬프트를 관리자로 띄운 후, 아래 커맨드로 실행

nmake install

 

특정 위치에 잘(?) 설치되어 있는거 확인

 

6. 활용

프로젝트를 생성하고 openssl 라이브러리 이용해보기

#include <openssl/ssl.h>

#pragma comment(lib,"libssl.lib")
#pragma comment(lib,"libcrypto.lib")

int main()
{
	SSL_library_init();
	return 0;
}

 

헤더파일 설정

라이브러리 설정

 

정상실행!

 

이제 윈도우에서도 오픈소스를 빌드해서 활용 가능!

반응형