Closed haifenghuang closed 2 years ago
请使用 git clone 将工程克隆下来使用,rc 文件版本是根据 git tag 自动导出的。没有 git 信息 rc 文件写入的内容无法编译通过。 或者切换 develop 分支,develop 分支写死了版本信息。
已合并至 master 分支。
我按照你的方法,试了一下git clone, 将develop分支克隆下来,使用命令编译后还是同样的问题。
BTW, 我的机器里安装有Visual Studio 2013 Community和Visual Studio 2017 Community,我的windows版本是win10.
麻烦你将执行 cmake 初始化命令后控制台输出的内充补充到 issue 中。
完整的初始化流程内容如下,请注意绿色高亮行中包含了 git 当前的信息,请检查您自己 clone 下来的工程中这些信息是否正确。
############# nim_win_demo ##############
-- The C compiler identification is MSVC 19.16.27045.0
-- The CXX compiler identification is MSVC 19.16.27045.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/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: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/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/1619605768/NIM_Windows_Demo_Build_Binaries_Release.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 http://yx-web.nos.netease.com/package/1624272662/NIM_CrossPlatform_SDK_v8.5.0.zip
-- ================== wrapper ==================
+ -- Current git tag: 8.5.0, commit count: 169, describe: 8.5.0-7-g9465b85f
############# 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: /build
下面是我运行cmake build的一部分结果:
############# nim_win_demo ##############
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041.
-- The C compiler identification is MSVC 19.16.27045.0
-- The CXX compiler identification is MSVC 19.16.27045.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: E:/Microsoft Visual Studio/2017 Community/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: E:/Microsoft Visual Studio/2017 Community/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 http://yx-web.nos.netease.com/package/1624272662/NIM_CrossPlatform_SDK_v8.5.0.zip
-- ================== wrapper ==================
-- Current git tag: 8.5.0, commit count: 1, describe: 8.5.0
############# 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
E:\Microsoft Visual Studio\2017 Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1498,5): error MSB6006:“rc.exe”已退出,代码为 1。 [E:\云信\云信2.0\NIM_PC_Demo\build\tool_kits\uninstall\uninstall.vcxproj]
奇怪的是,你提到的git那一行中,commit count是1, describe是8.5.0
下面是我运行cmake build的一部分结果:
############# nim_win_demo ############## -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041. -- The C compiler identification is MSVC 19.16.27045.0 -- The CXX compiler identification is MSVC 19.16.27045.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: E:/Microsoft Visual Studio/2017 Community/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: E:/Microsoft Visual Studio/2017 Community/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 http://yx-web.nos.netease.com/package/1624272662/NIM_CrossPlatform_SDK_v8.5.0.zip -- ================== wrapper ================== -- Current git tag: 8.5.0, commit count: 1, describe: 8.5.0 ############# 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 E:\Microsoft Visual Studio\2017 Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(1498,5): error MSB6006:“rc.exe”已退出,代码为 1。 [E:\云信\云信2.0\NIM_PC_Demo\build\tool_kits\uninstall\uninstall.vcxproj]
奇怪的是,你提到的git那一行中,commit count是1, describe是8.5.0
关注一下导出的 rc 文件中,版本号信息是否正确?
导出的rc文件,你是指哪些文件?另外如何查看版本号信息?
问题解决了。出现这个问题的原因:
克隆下来的仓库的放置目录中有中文。
因此解决办法就是【把目录中的中文更改为英文】。
问题解决了。出现这个问题的原因:
克隆下来的仓库的放置目录中有中文。
因此解决办法就是【把目录中的中文更改为英文】。
把目录更改成英文后,uninstall.exe
能够正确生成了,但是编译nim_demo.vcxproj
项目的时候,报告如下错误:
E:\yunxin2\NIM_PC_Demo\build\nim.rc(10): fatal error RC1015: cannot open include file 'afxres.h'. [E:\yunxin2\NIM_PC_De
mo\build\nim_win_demo\nim_demo.vcxproj]
问题解决了。出现这个问题的原因:
克隆下来的仓库的放置目录中有中文。
因此解决办法就是【把目录中的中文更改为英文】。
把目录更改成英文后,
uninstall.exe
能够正确生成了,但是编译nim_demo.vcxproj
项目的时候,报告如下错误:E:\yunxin2\NIM_PC_Demo\build\nim.rc(10): fatal error RC1015: cannot open include file 'afxres.h'. [E:\yunxin2\NIM_PC_De mo\build\nim_win_demo\nim_demo.vcxproj]
看了 #67 的问题,说是可以在nim.rc
文件中删除这个头文件afxres.h
,我删除了这个头文件后,结果又报告如下的错误:
error RC2144: PRIMARY LANGUAGE ID not a number
之后我又在nim.rc
文件加入了windows.h
文件:
#include <windows.h>
#include "resource.h"
终于能够正确的编译了。不知道这种解决方法是否正确?
问题解决了。出现这个问题的原因:
克隆下来的仓库的放置目录中有中文。
因此解决办法就是【把目录中的中文更改为英文】。
把目录更改成英文后,
uninstall.exe
能够正确生成了,但是编译nim_demo.vcxproj
项目的时候,报告如下错误:E:\yunxin2\NIM_PC_Demo\build\nim.rc(10): fatal error RC1015: cannot open include file 'afxres.h'. [E:\yunxin2\NIM_PC_De mo\build\nim_win_demo\nim_demo.vcxproj]
看了 #67 的问题,说是可以在
nim.rc
文件中删除这个头文件afxres.h
,我删除了这个头文件后,结果又报告如下的错误:error RC2144: PRIMARY LANGUAGE ID not a number
之后我又在
nim.rc
文件加入了windows.h
文件:#include <windows.h> #include "resource.h"
终于能够正确的编译了。不知道这种解决方法是否正确?
找不到 afxres.h 可能是你在安装 VS 时未安装 MFC/ATL 相关组件导致的,实际编译过程中可能并不需要这个组件,我会尝试解决这个问题。
使用如下的命令:
编译完成后,使用visual studio 2017打开
build
目录下的nim_win_demo.sln
进行编译,报告错误:下面是出错时的屏幕截图:
BTW, 我安装的
Visual Studio 2017 Community
是在E盘。