月度归档:2020年03月

openssl的编译

因为应用是跨平台,所以openssl的版本选择很重要,最好是应用使用的版本是与linux系统一致的。
当前Centos7.x已经开始使用1.0.2的版本,且官方也因为linux的广泛使用,也会一直维护该分支版。
打开其发布的版本页,找到1.0.2的最新版本:
https://github.com/openssl/openssl/releases

1.下载https://github.com/openssl/openssl/archive/OpenSSL_1_0_2u.tar.gz
2.解压并检查其下INSTALL.XXX文件,因为目标是WIN64,所以选择INSTALL.W64并按它的步骤下载相关组件及编译。
3.以下是摘取出来

 To build for Win64/x64:
 
 > perl Configure VC-WIN64A --prefix=c:\some\openssl\dir
 > ms\do_win64a
 > nmake -f ms\ntdll.mak
 > cd out32dll
 > ..\ms\test

4.仍需要下载并安装NASM工具,这个工具是INSTALL.WXX没有说及的。
http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/
附带完整的编译脚本
build_static_openssl_x64.bat

echo "init vc env"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
set path_script=%~dp0
set path=C:\Users\honey\AppData\Local\bin\NASM;%path%
cd /D %path_script%\openssl_1_0_2u
perl Configure VC-WIN64A --prefix=%path_script%\lib\static
call ms\do_win64a
nmake -f ms\nt.mak clean
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
nmake -f ms\nt.mak test

build_shared_openssl_x64.bat

echo "init vc env"
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
set path_script=%~dp0
set path=C:\Users\honey\AppData\Local\bin\NASM;%path%
cd /D %path_script%\openssl_1_0_2u
perl Configure VC-WIN64A --prefix=%path_script%\lib\shared
call ms\do_win64a
nmake -f ms\ntdll.mak clean
nmake -f ms\ntdll.mak
nmake -f ms\ntdll.mak install
nmake -f ms\ntdll.mak test

Qt的CMakefiles样本1

cmake_minimum_required(VERSION 3.1)
 
project(untitled3 LANGUAGES CXX)
 
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
find_package(Qt5 COMPONENTS core widgets REQUIRED)
 
add_executable(${PROJECT_NAME} "main.cpp" "qml.qrc")
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets)
##特别注意是Qt5而不是Qt

the difference between vt100 and vt102

The VT102 was a member of the “second generation” of the VT100 family.
The original VT100 was sold with a number of options that could be inserted
into the box. The most significant was the AVO, or Advanced Video Option,
which was pretty much just extra memory. The base VT100 supported a 24×80
mode and a 14×132 mode. It supported normal text plus one video attribute,
which could be either underlining or reverse-video – which one you got
depended on whether you selected an underline or box cursor. AVO gave you
24×132 mode and the full four video attributes (underline, reverse, bold,
blink). The VT100 also had a modem control option, providing extra RS-232
signals.
The VT102 was a closed system (no options) which provided the equivalent of
a VT100 plus AVO plus (I think) modem control. It also added one or two
new commands – if I remember correctly, “Insert Line” (open a new line,
scroll stuff below it down) and “Delete Line”, and perhaps “Insert” and
“Delete Character in Line”.
DEC many years ago *defined* “VT100 compatibility” as “equivalent to a
VT102”. All subsequent DEC products that claimed VT100 compatibility
actually supported the full 24×132 display mode, four video attributes, and
the additional commands. (Modem control is a separate issue – “VT100
compatibility” is usually taken to refer only to *software* compatibility.)
As far as I know, the industry has pretty much followed DEC’s definition,
except that many terminal emulators are incapable of properly supporting
the 132-wide mode due to limitations of their displays.
There is absolutely no difference between the keypads of VT100’s and
VT102’s.