**简 述: ** CMake 设置 Target 输出目录和后缀名

set(EXECUTABLE_OUTPUT_PATH                      "xxx/path")        		# 可执行文件的输出目录
set(LIBRARY_OUTPUT_PATH                         "xxx/path")        		#    库文件的输出目录

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG        "xxx/path")        		# debug   可执行文件的输出目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE      "xxx/path")        		# release 可执行文件的输出目录
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG        "xxx/path")       		# debug      库文件的输出目录
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE      "xxx/path")       		# release    库文件的输出目录
set(CMAKE_DEBUG_POSTFIX                         "xxx/path")       		# debug        库文件的后缀名
set(CMAKE_RELEASE_POSTFIX                       "xxx/path")       		# release      库文件的后缀名

set_target_properties(${TARGET_NAME} PROPERTIES DEBUG_POSTFIX "_d")     # debug      可执行文件的后缀名
set_target_properties(${TARGET_NAME} PROPERTIES RELEASE_POSTFIX "_r")   # release   可执行文件的后缀名

简 述: Windows 编程中常见的一些类型意义、区别和讲解定义

  1. PVOID 和 LPVOID
  2. LPSTR / LPCSTR / LPTSTR / LPCTSTR / LPWSTR / LPCWSTR
  3. HWND / HANDLE / HMODULE / HINSTANCE

辨别区分标志

  • L –> long;WIN32 下 long 和 int 长度一样。 故 L 和 LP 无区别
  • C –> const
  • T –> 通用版本,依据 UNICODE 时候被定义,确定使用 A 还是 W 版本的函数、或字符集。
  • STR –> string 字符串
  • PTR –> ptr 指针

Windows 编程

简 述: 哇卡卡卡,这次又抓到了 Microsoft win10 的 🐛,这次还影响到了我写代码哦🙄。项目使用 Release X86 编译会成功,而切换到 Release X64 编译会失败。

Error (active) E0147 declaration is incompatible with “BOOLEAN _BitScanForward” (declared at line 2825 of “C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h”) C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\intrin0.inl.h 123

Error C2007 #define syntax C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h 38
Error C2144 syntax error: ‘int’ should be preceded by ‘;’ C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h 43
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h 43

Visual Studio调试