BelledonneCommunications / linphone-sdk

Mirror for linphone-sdk (https://gitlab.linphone.org/BC/public/linphone-sdk.git)
GNU Affero General Public License v3.0
99 stars 79 forks source link

Compilation issues in Windows #312

Open shivbuyya opened 1 year ago

shivbuyya commented 1 year ago

Hi,

I am trying to compile linphone-sdk source code in Windows 11. Unfortunately I am getting following issues:

As per the ReadMe in the github page, installed as shown below:

  1. Visual Studio 16 2019 with Windows Universal Platform development, Desktop C++ Development, .NET Development.
  2. MSYS2, and installed Cmake >= 3.22, python >= 3.6, pip (or pip3 if the build machine has both python2 and python3), yasm, nasm, doxygen, Pystache (use pip install pystache or pip3 install pystache), six, 7zip.
  3. Have set env path: C:\msys64\mingw\bin, C:\msys64\ and C:\msys64\usr\bin

downloaded code with : git clone https://github.com/BelledonneCommunications/linphone-sdk.git --recursive

Commands to compile: cd linphone-sdk cmake --preset=windows-sdk -DENABLE_WINDOWS_TOOLS_CHECK=ON cmake --build --preset=windows-sdk

Error shown: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(436,5): error MSB8013: This project doesn't contain the Configuration and Platform combination of Debug|x64. [D:\Work_Data\VideoCall_Windows\Linphone_SDK\New_LinphoneSDK\linphone-sdk\build\win\ZERO_CHECK.vcxproj]

From the above error, I thought may be it is 32-bit and 64-bit issue: so tried with command: cmake --build --preset=windows-sdk --config RelWithDebInfo -A Win32

Got below Error: -- Looking for mbedtls_ssl_conf_dtls_srtp_protection_profiles - not found CMake Error at bctoolbox/cmake/FindMbedTLS.cmake:84 (add_library): add_library cannot create imported target "mbedtls" because another target with the same name already exists. Call Stack (most recent call first): bctoolbox/CMakeLists.txt:80 (find_package)

CMake Error at bctoolbox/cmake/FindMbedTLS.cmake:84 (add_library): add_library cannot create imported target "mbedx509" because another target with the same name already exists. Call Stack (most recent call first): bctoolbox/CMakeLists.txt:80 (find_package)

-- Could NOT find MbedTLS (missing: MBEDTLS_INCLUDE_DIRS) CMake Error at bctoolbox/cmake/FindMbedTLS.cmake:84 (add_library): add_library cannot create imported target "mbedcrypto" because another target with the same name already exists. Call Stack (most recent call first): bctoolbox/CMakeLists.txt:80 (find_package)

-- Could NOT find Decaf (missing: Decaf_DIR) -- DTLS SRTP not available CMake Error at bctoolbox/CMakeLists.txt:123 (find_package): Could not find a package configuration file provided by "BcUnit" with any of the following names:

  BcUnitConfig.cmake
  bcunit-config.cmake

Add the installation prefix of "BcUnit" to CMAKE_PREFIX_PATH or set
"BcUnit_DIR" to a directory containing one of the above files.  If "BcUnit"
provides a separate development package or SDK, be sure it has been
installed.

-- Configuring incomplete, errors occurred! C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for 'D:\Work_Data\VideoCall_Windows\Linphone_SDK\New_Linp honeSDK\linphone-sdk\build\win\CMakeFiles\84b4775c65d7dfbf97210e989390285f\win-64bits.rule;D:\Work_Data\VideoCall_Windows\Linphone_SDK\New_LinphoneSDK\linphone-sdk\CMakeLists.txt' exited with code 1. [D:\Work_D ata\VideoCall_Windows\Linphone_SDK\New_LinphoneSDK\linphone-sdk\build\win\win-64bits.vcxproj]

Please suggest how to resolve the issue?

shivbuyya commented 1 year ago

I got help from the response of @KyronNextLevel in the issue: https://github.com/BelledonneCommunications/linphone-sdk/issues/34

so I have compiled source code using Commands suggested by @KyronNextLevel for RelWithDebInfo : cmake .. -G "Visual Studio 15 2017" -DLINPHONESDK_PLATFORM=Desktop -DENABLE_CSHARP_WRAPPER=YES -DENABLE_UNIT_TESTS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake --build . --target sdk --config RelWithDebInfo -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false

But still getting below error:

d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\abstract-chat-room.h(81): error C3431: 'EphemeralMode': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\liblinphone\coreapi\ec-calibrator.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Build\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linph one.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\chat-room-params.h(39): error C3431: 'Backend': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desk top\linphone-sdk\liblinphone\coreapi\ec-calibrator.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Build\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone.vcxp roj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\chat-room-params.h(46): error C3431: 'EncryptionBackend': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\lin phone-desktop\linphone-sdk\liblinphone\coreapi\ec-calibrator.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\d esktop\Build\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\abstract-chat-room.h(81): error C3431: 'EphemeralMode': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linph one-desktop\linphone-sdk\liblinphone\coreapi\carddav.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Build\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone.vc xproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\abstract-chat-room.h(81): error C3431: 'EphemeralMode': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linph one-desktop\linphone-sdk\liblinphone\coreapi\dict.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Build\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone.vcxpr oj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\chat-room-params.h(39): error C3431: 'Backend': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desk top\linphone-sdk\liblinphone\coreapi\carddav.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Build\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone.vcxproj] [ D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\chat-room-params.h(46): error C3431: 'EncryptionBackend': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\liblinphone\coreapi\carddav.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Build\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone. vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\chat-room-params.h(39): error C3431: 'Backend': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\liblinphone\coreapi\dict.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Build\linpho ne\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\chat-room-params.h(46): error C3431: 'Encrypti onBackend': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\liblinphone\coreapi\dict.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Bu ild\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\abstract-chat-room.h(81): error C3431: 'EphemeralMode': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\liblinphone\coreapi\enum.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Build\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone.vcxpr oj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\abstract-chat-room.h(81): error C3431: 'Epheme ralMode': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linph one-desktop\linphone-sdk\liblinphone\coreapi\echo-tester.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Build\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj] d:\work_data\videocall_windows\linphone_desktop\linphone-desktop\linphone-sdk\liblinphone\src\chat\chat-room\chat-room-params.h(39): error C3431: 'Backend': a scoped enumeration cannot be redeclared as an unscoped enumeration (compiling source file D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\liblinphone\coreapi\enum.c) [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\WORK\desktop\Build\linphone\coreapi\linphone-coreapi.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\desktop\EP_linphone.vcxproj] [D:\Work_Data\VideoCall_Windows\Linphone_Desktop\linphone-desktop\linphone-sdk\build\sdk.vcxproj]