分类目录归档:C++

VNC的安装

服务端安装:
yum -y install tigervnc-server
启动服务,直接执行,然后按提示输入访问密码。
vncserver

vs2013编译兼容xp版本代码

在vs2017中需要加上_USING_V110_SDK71_,强制指定SDK的版本。
perl Configure VC-WIN32 –prefix=H:\VC_INCLUDE\OpenSSL-Win32_MSVC141_xp -D_WIN32_WINNT=0x0501 -D_USING_V110_SDK71_
在VS2013中
perl Configure VC-WIN32 –prefix=H:\VC_INCLUDE\OpenSSL-Win32_MSVC141_xp -D_WIN32_WINNT=0x0501

 这不是它的工作方式。 回到VS2012,您使用了Project + Properties,General,Platform Toolset设置并选择了v110_xp 。 这进行了几次设置更改。 作为副作用 ,您还可以定义_USING_V110_SDK71_宏。 这是准确的,其中一个设置更改是您将使用SDK版本7.1标头和库而不是版本8. 7.1是最后一个仍与XP兼容的SDK版本。  
 这对任何事情都不重要,到目前为止,您获得的最重要的变化是链接器的系统,最低要求版本设置。 使用v110_xp可确保将此设置更改为XP版本号5.01。 没有它你的目标6.00,Vista版本号。 这是一个非常重要的设置,当您告诉它您设计的程序在最新的Windows版本上运行良好时,Windows会关注它并关闭几个appcompat垫片。  
 在VS2013中它仍然可以正常工作。 选择v120_xp工具集。
That's not the way it worked. Back in VS2012, you used the Project + Properties, General, Platform Toolset setting and selected v110_xp. Which made several setting changes. As a side-effect, you'd also get the _USING_V110_SDK71_ macro defined. Which is accurate, one of the setting changes is that you'll use the SDK version 7.1 headers and libraries instead of version 8. 7.1 is the last SDK version that's still compatible with XP. 
Which isn't actually important for anything, by far the most important change that you got was the linker's System, Minimum Required Version setting. Using v110_xp ensured that this setting was changed to 5.01, the XP version number. Without it you target 6.00, the Vista version number. It is a very important setting, Windows pays attention to it and turns off several appcompat shims when you tell it that you designed your program to run well on the latest Windows versions. 
It still works the same in VS2013. Select the v120_xp toolset.

JETBRAIN/phpstorm/golang/clion的永久激活码

V0Z5FCVKUI-eyJsaWNlbnNlSWQiOiJWMFo1RkNWS1VJIiwibGljZW5zZWVOYW1l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qbBVNBL4jbiL3i3xsfNiyJgaZ5sX7i8tmStEpLbPwvHcByuf59qJhV/bZOl8KqJBETCDJcY6O2aqhTUy+9x93ThKs1GKrRPePrWPluud7ttlgtRveit/pcBrnQcXOl1rHq7ByB8CFAxNotRUYL9IF5n3wJOgkPojMy6jetQA5Ogc8Sm7RG6vg1yow==

CMake的目录输出

也许是CMake的版本问题,某些时候以下配置只需要配置其中一项就可以达到目的,有的根本无效。
—————————————————————-
———-这是Window的特色设置,在Linux中只需要一个CMAKE_INSTALL_PREFIX即可—————-
—————————————————————
以下是几乎百分百有效的配置。

SET(CMAKE_EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_EXECUTABLE_OUTPUT_PATH_DEBUG ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_EXECUTABLE_OUTPUT_PATH_RELEASE ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_LIBRARY_OUTPUT_PATH_DEBUG ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_LIBRARY_OUTPUT_PATH_RELEASE ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/bin)

Qt项目。
cmake -A x64 -T host=x64 ../wotermt生成vc工程。
cmake –build . –config Release采用Release编译。

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

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.

ssh的连接复用

Host mini
   ControlPath ~/.ssh/master-%r@%h:%p
   ControlMaster auto
   ControlPersist yes
   HostName 192.168.10.104
   Port 22
   User abc

VC2017的运行时库提取

如果你是用Visual Studio 2015和2017来编写C或C++程序,那么就已经是基于UCRT的。
为了方便提取运行时库,请安装EveryThing搜索工具。
工具下载地址:https://www.voidtools.com/zh-cn/downloads/
以VC2017运行时库为例。
VC2017运行时库【UCRT库】包括以下几种文件。
Microsoft.VC141.CRT:
1.在EveryThing的输入界面搜索:Microsoft.VC141.CRT

2.再搜索ucrt,在Redist的子目录下,才是正常的UWP或ucrt库,文件一般是41个。