'Story List'에 해당되는 글 179건
- 2022.01.01 :: [펌] 속도 비교: Python vs C/C++ vs Assembly
- 2021.12.19 :: [Bitcoin] qt 라이브러 사용
- 2021.12.19 :: [QT] qt 라이브러리 설치
- 2021.11.26 :: [vcpkg] boost 설치 및 사용 예제
- 2021.11.23 :: [Bitcoin] Build + Visual studio 2019
- 2021.11.19 :: [에러] 'atlbase.h': No such file or directory
- 2021.11.19 :: [메모리 기본값] 메모리 가비지(?)
- 2021.11.19 :: [에러] fatal error C1905: 프런트 엔드와 백 엔드가 호환되지 않습니다. 같은 프로세서를 대상으로 해야 합니다
- 2021.11.18 :: [보안] arch.exe 바이러스 인가? 아닌가?
- 2021.11.04 :: [vcpkg] Please install the English language pack
10년전에는 Java와 Python과 같은 인터프리터(interpreter)언어에 대한 속도 문제(?)에 대해서 이슈가 되었지만, 최근에는 이러한 내용이 크게 이슈(^^)가 되지 않고 있습니다. 그 이유는 여러가지가 있지만, 개인적으로 하드웨어의 성능과 개발에 대한 Quality를 평가하는 부분이 많이 바뀌었기 때문입니다.
그래도 아래의 영상은 한번씩은 한번씩 보는 것이 좋을 듯합니다.

https://www.youtube.com/watch?v=3PcIJKd1PKU
몇몇 분들이 Bitcoin 빌드시에 윈도우 상에서 qt 라이브러리도 포함해서 빌드시 에러에 대해서 문의 하신 분이 있어 제가 작업했던 부분을 공유 드리고자 합니다.
[작업내용]
Windows상의 Bitcoin 소스를 빌드하고자 할때, qt 라이브러리는 "static"이어야 합니다.
그래서, https://choiwonwoo.tistory.com/category/MINERVA/C_CPP에 나와 있는 방법으로 qt를 설치하여 사용하면 않됩니다. 그 이유는 "dynamic"이기 때문입니다.
[static qt library]
https://bitcoin.forum/t/building-bitcoin-core-with-visual-studio/39
Building Bitcoin Core with Visual Studio
Introduction Solution and project files to build the Bitcoin Core applications msbuild or Visual Studio can be found in the build_msvc directory. The build has been tested with Visual Studio 2019 (building with earlier versions of Visual Studio should not
bitcoin.forum
위의 페이지에서 QT에 관련된 부분은 아래와 같습니다.

'here'로 된 부분을 선택하면,
아래와 같이 직접 qt 라이브러리를 직접 build하여 static library를 얻는 방법에 대해서 설명하고 있습니다.
https://github.com/sipsorcery/qt_win_binary
GitHub - sipsorcery/qt_win_binary: This repository contains static builds of Qt for Windows that are compatible with Bitcoin Cor
This repository contains static builds of Qt for Windows that are compatible with Bitcoin Core. - GitHub - sipsorcery/qt_win_binary: This repository contains static builds of Qt for Windows that ar...
github.com
위 방법을 통해서 얻게된 static qt library를 bitcoin build시에 설정해서 하시면 됩니다.
감사합니다.
1. qt 설치
몇년전만 해도 qt 라이브러리는 용량도 어마어마하게 크고, 소스를 통해서 빌드할때 많은 시간을 들여야 했습니다.
하지만 이제는 라이브러리를 개발하면서, 배포부분도 많은 배려를 해주고 있어 쉽게 됩니다.
(* 하지만 여전히 소스 빌드를 필요로 하는 부분도 있습니다.)
1) 적절한 설치 파일 선택
1) https://download.qt.io/official_releases/
Index of /official_releases
download.qt.io
위 디렉토리에서 online_installers를 선택후, 윈도우 설치 파일을 다운로드


2) 설치 시작













참고:
vcpkg에 대한 사용 예제를 메시지로 부탁하신 분이 있어서 정리를 하여 보았습니다
1) boost 다운로드
- 64 bit dynamic: vcpkg install boost:x64-windows
- 64 bit static: vcpkg install boost:x64-windows-static

2) boost 확인
- vcpkg list

3) boost를 visual studio에 연결(?)

위에 설명이 된대로, boost라이브러리를 사용시, 별도의 include와 libraray path설정없이 이제 바로 사용가능함
4) boost를 활용한 예제
- 쓰레드를 생성하는 예제 #include <iostream> #include <typeinfo> #include <thread> #include <boost/thread.hpp> using namespace std; void myTest() { thread::id t_id = this_thread::get_id(); cout << "thread called: " << typeid(t_id).name() <<' '<< sizeof(t_id) << 'T:' << t_id << endl; } int main() { //-- cout << "thread calling" << endl; //-- 쓰레드 생성: 4개 T1~T4 boost::thread workerThread1(myTest); boost::thread workerThread2(myTest); boost::thread workerThread3(myTest); boost::thread workerThread4(myTest); //-- 각 쓰레드 작업 완료 대기 workerThread1.join(); workerThread2.join(); workerThread3.join(); workerThread4.join(); cout << "thread done" << endl; } |

- 개발 작업을 할때, 별도의 라이브러리와 관련된 작업을 할필요가 없다.(include, library path...)
그리고, 제일 좋은 점은 개발에 사용된 라이브리를 자동으로 실행파일 위치에 복사여준다는 부분이 최고로 편함.
(이제는, XCOPY ...어쩌구 하는 작업을 하지 않아도 된다. 만세!!!)
감사합니다.
작년부터 작업했던 비트코인 소스에 대한 분석 작업을 정리하여 올리고자 합니다.
서비스 구성에 대한 부분은 리눅스로 구축을 하였지만, 소스에 대한 분석 리눅스 환경보다는 개인적으로 Visual studio에서 하는것이 역시 생산성이 높은 듯하다.
첫번째 작업은 역시 소스의 다운로드와 컴파일이다.
1) git clone https://github.com/bitcoin/bitcoin.git
GitHub - bitcoin/bitcoin: Bitcoin Core integration/staging tree
Bitcoin Core integration/staging tree. Contribute to bitcoin/bitcoin development by creating an account on GitHub.
github.com
2) https://bitcoin.forum/t/building-bitcoin-core-with-visual-studio/39

추가적으로 vcpkg와 qt를 버젼에 맞게 구성해놓으면 아래와 같이 정상적으로 빌드가 됩니다.
디버그 버젼: bitcoin\build_msvc>msbuild /m bitcoin.sln /p:Platform=x64 /p:Configuration=Debug /t:build


[중요바이너리 설명]
1. Bitcoin Core Wallet - Located at \local\bitcoin-qt.exe. Bitcoin Core Wallet is a combination of full Bitcoin peer and wallet frontend.
2. Bitcoin Core Daemon - Located at \local\bitcoind.exe. Bitcoin Core Daemon is the Bitcoin peer, which you can interact with through RPCs to port 8332 (or 18332 for testnet).
3. Bitcoin CLI (Command Line Interface) - Located at \local\bitcoin-cli.exe. Bitcoin CLI allows you to send RPC commands to Bitcoin Daemon (bitcoind).
4. Bitcoin Transaction - Located at \local\bitcoin-tx.exe. Bitcoin Transaction allows you to create and update Bitcoin transactions.
개발 PC를 새로 장만 후, 작업 프로젝트의 소스를 다시 빌드시 아래와 같은 에러가 발생하여 잠시 당황하였다가 기억을 더듬어 다음과 같이 처리하였습니다.
[에러화면]
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um\sphelper.h(51): fatal error C1083: 포함 파일을 열 수 없습니다. 'atlbase.h': No such file or directory
[해결]

아래의 값은 컴파일러에 의해서 세팅되는 메모리 값입니다.
(*가급적 모든 변수/메모리는 반드시 초기화하는 습관을 가지는것이 제일 듯합니다.)
- 64 bits
[초기화 되지 않은 지역변수]
0xCCCCCCCCCCCCCCCC
[초기화 되지 않은 Heap 메모리]
0xCDCDCDCDCDCDCDCD
[Free된 Heap 메모리]
0xDDDDDDDDDDDDDDDD or 0xFEEEFEEEFEEEFEEE
[할당된 Heap 메모리를 벗어난 공간]
0xFDFDFDFDFDFDFDFD
- 32 bits
[초기화 되지 않은 지역변수]
0xCCCCCCCC
[초기화 되지 않은 Heap 메모리]
0xCDCDCDCD
[Free된 Heap 메모리]
0xDDDDDDDD or 0xFEEEFEEE
[할당된 Heap 메모리를 벗어난 공간]
0xFDFDFDFD
추가 도움 내용:
4. 메모리 값을 보고 현재 메모리 상태를 알아보자.
WFC Technical Note 006 - Funny Memory Values Introduction Microsoft has put quite a lot of memory leak detection helpers in Windows NT. They have not done a good job of advertising it. This document..
choiwonwoo.tistory.com
오픈소스 라이브러를 사용하다가, 아래의 에러를 접하는 경우가 있습니다.
[에러메시지]
LINK : fatal error C1905: 프런트 엔드와 백 엔드가 호환되지 않습니다. 같은 프로세서를 대상으로 해야 합니다.
LINK : fatal error LNK1257: 코드를 생성하지 못했습니다.
LINK : fatal error LNK1327: link.exe을(를) 실행하는 동안 오류가 발생했습니다.

이런 경우는 빌드환경과 빌드 아키텍쳐가 호환되지 않을때 발생합니다.
예: 64 bits 빌드를 진행하고 있는데, 32 bits 라이브러리를 사용하는 경우
이런 경우는 해당 라이브리의 버젼을 확인해봐야 합니다.
--> Visual studio에 포함된 dumpbin 사용하면 됩니다.

[사용예]

오픈소스 빌드 중에 해당 파일에 대해, 백신(V3)에서 트로이안 목마 바이러스라고 메시지를 띄워 찾아 보았습니다.
결론부터 말하면 아닙니다.
arch.exe 는 architecture의 약자로, 윈도우 환경에서 리눅스 환경환경을 구축하는 역활을 하고 있습니다.
자세한 내용은 아래를 확인해보시면 됩니다.
http://windowsbulletin.com/files/exe/intel-corporation/intel-xdk/arch-exe
What is arch.exe? Is it Safe or a Virus? How to remove or fix it
arch.exe is a program developed by Intel Corporation.
windowsbulletin.com
위사이트에서 이기능은 다운받아 한번씩 PC를 점검하기 좋을듯합니다.

새로운 개발 PC를 장만해서, 개발환경을 설치후, 소스를 다운받아 빌드가 않되어 잠시(?) 삽질을하게 되어 기록차원에서 정리를 하고자 합니다.
아래 예제와 같이 vcpkg를 통해 필요한 라이브러리를 설치하고자 할때 아래와 같은 에러가 발생하는 경우가 있습니다.

[해결]
1) visual studio installer를 기동

2) 수정 선택

3) 언어 추가 설치


4) Visual studio 환경 설정


5) 다시빌드
다시 빌드를 하면 아래와 같이 visual studio 2019는 더이상 노란메시지가 나오지 않음을 확인할수 있다.
(참고로, 현재 아래의 노란색 경고의 메시지는 제 PC에 설치된 visual studio 2013의 경우에는 영어 언어 팩이 설치되어 있지 않아 발생하고 있다. 이것 역시 위와 똑같이 설정을 해주면 됨.)

6) Visual studio 연결/해제
- vcpkg integrate install 명령으로 Visual Studio 연결 설정
- vcpkg integrate remove 명령으로 Visual Studio 연결 해제