netease-kit / NIM_PC_Demo

云信Windows(PC) C/C++ Demo源码仓库
Other
275 stars 174 forks source link

MSB6006 “rc.exe”已退出,代码为 1 #64

Closed haifenghuang closed 2 years ago

haifenghuang commented 3 years ago

使用如下的命令:

cmake . -B build -G"Visual Studio 15 2017" -T"v141_xp" -DBUILD_WITH_NERTC_G2=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug --target install

编译完成后,使用visual studio 2017打开build目录下的nim_win_demo.sln进行编译,报告错误:

MSB6006 “rc.exe”已退出,代码为 1

下面是出错时的屏幕截图:

image

BTW, 我安装的Visual Studio 2017 Community是在E盘。

nmgwddj commented 3 years ago

请使用 git clone 将工程克隆下来使用,rc 文件版本是根据 git tag 自动导出的。没有 git 信息 rc 文件写入的内容无法编译通过。 或者切换 develop 分支,develop 分支写死了版本信息。

nmgwddj commented 3 years ago

已合并至 master 分支。

haifenghuang commented 3 years ago

我按照你的方法,试了一下git clone, 将develop分支克隆下来,使用命令编译后还是同样的问题。

BTW, 我的机器里安装有Visual Studio 2013 Community和Visual Studio 2017 Community,我的windows版本是win10.

nmgwddj commented 3 years ago

麻烦你将执行 cmake 初始化命令后控制台输出的内充补充到 issue 中。

nmgwddj commented 3 years ago

完整的初始化流程内容如下,请注意绿色高亮行中包含了 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
haifenghuang commented 3 years ago

下面是我运行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

nmgwddj commented 3 years ago

下面是我运行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 文件中,版本号信息是否正确?

haifenghuang commented 3 years ago

导出的rc文件,你是指哪些文件?另外如何查看版本号信息?

haifenghuang commented 3 years ago

问题解决了。出现这个问题的原因:

克隆下来的仓库的放置目录中有中文。

因此解决办法就是【把目录中的中文更改为英文】。

haifenghuang commented 3 years ago

问题解决了。出现这个问题的原因:

克隆下来的仓库的放置目录中有中文。

因此解决办法就是【把目录中的中文更改为英文】。

把目录更改成英文后,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]
haifenghuang commented 3 years ago

问题解决了。出现这个问题的原因:

克隆下来的仓库的放置目录中有中文。

因此解决办法就是【把目录中的中文更改为英文】。

把目录更改成英文后,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"

终于能够正确的编译了。不知道这种解决方法是否正确?

nmgwddj commented 3 years ago

问题解决了。出现这个问题的原因:

克隆下来的仓库的放置目录中有中文。

因此解决办法就是【把目录中的中文更改为英文】。

把目录更改成英文后,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 相关组件导致的,实际编译过程中可能并不需要这个组件,我会尝试解决这个问题。