NIM_PC_DEMO
网易云信 PC IM Demo 是基于网易云信 PC SDK 制作的即时通讯示例程序,UI 库使用 NIM Duilib 制作。
1、预览
2、最低要求
- CMake 3.10 或以上版本。
- Visual Studio 2017 或以上版本。
- Git。
3、开发步骤
NIM Demo 从 8.4.0 版本开始使用 CMake 管理工程结构,您需要下载安装 CMake 并安装到系统中:。
源代码脚本中使用 Git 和 CMake 指令根据当前仓库的提交信息、提交次数来动态生成的目录结构及
.rc
文件版本,您系统中必须安装 Git 客户端并推荐使用 git clone 下载代码而不是直接下载压缩包!
安装完成后,首先克隆项目到你的磁盘中:
git clone https://github.com/netease-kit/NIM_PC_Demo.git
准确无误后会看到如下信息:
$ git clone https://github.com/netease-kit/NIM_PC_Demo.git
Cloning into 'NIM_PC_Demo'...
remote: Enumerating objects: 20981, done.
remote: Counting objects: 100% (2695/2695), done.
remote: Compressing objects: 100% (1404/1404), done.
remote: Total 20981 (delta 1247), reused 2577 (delta 1216), pack-reused 18286
Receiving objects: 100% (20981/20981), 1.44 GiB | 2.23 MiB/s, done.
Resolving deltas: 100% (10680/10680), done.
Updating files: 100% (4176/4176), done.
执行如下命令进行工程初始化:
cmake -Bbuild -G"Visual Studio 15 2017"
执行如上命令后,会自动下载依赖的三方库文件并解压到工程目录下,如执行无误您将看到如下信息:
$ cmake -Bbuild -G"Visual Studio 15 2017"
############# nim_win_demo ##############
-- No CMAKE_BUILD_TYPE selected, defaulting to Debug
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.16.27049.0
-- The CXX compiler identification is MSVC 19.16.27049.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/visual studio 2017 ide/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/visual studio 2017 ide/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Downloading third party libraries from http://yx-web.nos.netease.com/package/1619605746/NIM_Windows_Demo_Build_Binaries_Debug.zip
-- Downloading NeRTC-SDK from http://yx-web.nos.netease.com/package/1618217725/NERtc_Windows_SDK_v4.1.1.zip
-- Downloading NIM cross-platform SDK from https://yx-web-nosdn.netease.im/package/nim-win32-ia32-9-9-0-383-build-1750145.tar.gz
-- ================== NetEase IM SDK C++ wrapper ==================
-- Current git tag: 8.4.1, commit count: 233, describe: 8.4.1-46-gd0e39e74
############# core #############
############# base #############
############# duilib #############
############# shared #############
############# db #############
############# transfer file P2P #############
############# av_kit #############
############# rtc_kit #############
############# capture_image #############
############# image_view #############
############# nim_service #############
############# ui_kit #############
############# cef_module #############
############# cef_render #############
############# libcef_dll_wrapper #############
############# app_sdk #############
############# nim_demo #############
############# nim demo uninstaller #############
-- Configuring done
-- Generating done
-- Build files have been written to: D:/NIM_PC_Demo/NIM_PC_Demo/build
您可以通过打开 build 目录下的 nim_win_demo.sln
来进行调试或通过 CMake 命令直接编译:
cmake --build build --config Debug --target INSTALL
编译完成后会自动拷贝程序到代码根目录的 bin 文件夹下,会看到以下部分代码;
uninstall.vcxproj -> D:\NIM_PC_Demo\NIM_PC_Demo\build\tool_kits\uninstall\Debug\uninstall.exe
Building Custom Rule D:/NIM_PC_Demo/NIM_PC_Demo/CMakeLists.txt
-- Install configuration: "Debug"
-- Installing: D:/NIM_PC_Demo/NIM_PC_Demo/pdb/render.pdb
-- Installing: D:/NIM_PC_Demo/NIM_PC_Demo/pdb/nim_demo.pdb
-- Installing: D:/NIM_PC_Demo/NIM_PC_Demo/pdb/uninstall.pdb
-- Installing: D:/NIM_PC_Demo/NIM_PC_Demo/bin/uninstall.exe