ccmakegnuninjalinphone-sdk

Linphone-sdk desktop build failed: error: missing binary operator before token "("


I followed the guide in the page linphone-sdk and also run these with the MSYS2 MSYS command in Windows 10:

pacman -S mingw-w64-i686-cmake
pacman -S mingw-w64-i686-ninja
pacman -S p7zip

My PATH variable contains these:

...C:\msys64;C:\msys64\usr\bin;C:\msys64\mingw32\bin;C:\msys64\mingw64\bin;C:\msys64\usr\lib\p7zip;...

Then I run the configuration command:

cmake -DENABLE_AAUDIO=OFF -DENABLE_ADVANCED_IM=NO -DENABLE_AMRNB=OFF -DENABLE_AMRWB=OFF -DENABLE_ASSETS=NO -DENABLE_BV16=NO -DENABLE_CAMERA2=OFF -DENABLE_CODEC2=OFF -DENABLE_CSHARP_WRAPPER=OFF -DENABLE_CXX_WRAPPER=NO -DENABLE_DB_STORAGE=NO -DENABLE_DEBUG_LOGS=YES -DENABLE_DOC=OFF -DENABLE_EMBEDDED_OPENH264=OFF -DENABLE_FFMPEG=OFF -DENABLE_G726=OFF -DENABLE_G729=OFF -DENABLE_G729B_CNG=OFF -DENABLE_GPL_THIRD_PARTIES=NO -DENABLE_GSM=NO -DENABLE_GTK_UI=OFF -DENABLE_H263=OFF -DENABLE_H263P=OFF -DENABLE_ILBC=OFF -DENABLE_ISAC=OFF -DENABLE_JAVA_WRAPPER=OFF -DENABLE_JAZZY_DOC=OFF -DENABLE_JPEG=NO -DENABLE_LIME=OFF -DENABLE_LIME_X3DH=NO -DENABLE_MBEDTLS=YES -DENABLE_MDNS=OFF -DENABLE_MKV=NO -DENABLE_MPEG4=OFF -DENABLE_NLS=OFF -DENABLE_NON_FREE_CODECS=OFF -DENABLE_OPENH264=OFF -DENABLE_OPUS=NO -DENABLE_PCAP=OFF -DENABLE_POLARSSL=OFF -DENABLE_QRCODE=OFF -DENABLE_RTP_MAP_ALWAYS_IN_SDP=OFF -DENABLE_SILK=OFF -DENABLE_SOCI_MYSQL=OFF -DENABLE_SPEEX=YES -DENABLE_SQLITE=YES -DENABLE_SRTP=NO -DENABLE_SWIFT_WRAPPER=OFF -DENABLE_TOOLS=NO -DENABLE_TUNNEL=OFF -DENABLE_UNIT_TESTS=NO -DENABLE_UNMAINTAINED=OFF -DENABLE_UPDATE_CHECK=OFF -DENABLE_V4L=OFF -DENABLE_VCARD=NO -DENABLE_VIDEO=NO -DENABLE_VPX=OFF -DENABLE_WASAPI=ON -DENABLE_WEBRTC_AEC=YES -DENABLE_WEBRTC_AECM=YES -DENABLE_WEBRTC_VAD=OFF -DENABLE_X264=OFF -DENABLE_XML2=NO -DENABLE_ZLIB=NO -DENABLE_ZRTP=NO -DENABLE_ZRTP=OFF ..

and then the build command:

cmake --build .

I got following build errors (contains from the build log the parts where are the word "failed"):

...
[6/10] Forcing build for 'desktop'
[7/10] Performing build step for 'sdk'
FAILED: sdk-prefix/src/sdk-stamp/sdk-build C:/e/linphone-sdk/build/sdk-prefix/src/sdk-stamp/sdk-build 
cmd.exe /C "cd /D C:\e\linphone-sdk\build\desktop && C:\msys64\mingw32\bin\cmake.exe --build . && C:\msys64\mingw32\bin\cmake.exe -E touch C:/e/linphone-sdk/build/sdk-prefix/src/sdk-stamp/sdk-build"
[1/128] Creating directories for 'EP_speex'
[2/128] Creating directories for 'EP_jsoncpp'
...
[29/128] Forcing build for 'EP_jsoncpp'
[30/128] Performing build step for 'EP_mbedtls'
FAILED: C:/e/linphone-sdk/build/WORK/desktop/Stamp/EP_mbedtls/EP_mbedtls-build 
cmd.exe /C "cd /D C:\e\linphone-sdk\build\WORK\desktop\Build\mbedtls && C:\msys64\mingw32\bin\cmake.exe --build . && C:\msys64\mingw32\bin\cmake.exe -E touch C:/e/linphone-sdk/build/WORK/desktop//Stamp/EP_mbedtls/EP_mbedtls-build"
[1/89] Building C object library/CMakeFiles/mbedx509.dir/pkcs11.c.obj
[2/89] Building C object library/CMakeFiles/mbedx509.dir/certs.c.obj
...
[63/89] Building C object library/CMakeFiles/mbedcrypto.dir/pkcs5.c.obj
[64/89] Building C object library/CMakeFiles/mbedcrypto.dir/entropy_poll.c.obj
FAILED: library/CMakeFiles/mbedcrypto.dir/entropy_poll.c.obj 
C:\msys64\mingw32\bin\cc.exe -Dmbedcrypto_EXPORTS -IC:/e/linphone-sdk/external/mbedtls/include -IC:/e/linphone-sdk/external/mbedtls/library -Wall -Wextra -Wwrite-strings -Wvla -Wlogical-op -Wshadow -Wformat-signedness -Werror -Wmissing-declarations -Wmissing-prototypes -O2 -g -DNDEBUG -D_WIN32_WINNT=0x0600 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -w -MD -MT library/CMakeFiles/mbedcrypto.dir/entropy_poll.c.obj -MF library\CMakeFiles\mbedcrypto.dir\entropy_poll.c.obj.d -o library/CMakeFiles/mbedcrypto.dir/entropy_poll.c.obj -c C:/e/linphone-sdk/external/mbedtls/library/entropy_poll.c
C:/e/linphone-sdk/external/mbedtls/library/entropy_poll.c:59:101: error: missing binary operator before token "("
   59 | #if defined(WINAPI_FAMILY_PARTITION) && defined (WINAPI_PARTITION_PC_APP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP)
      |                                                                                                     ^
[65/89] Building C object library/CMakeFiles/mbedcrypto.dir/version.c.obj
[66/89] Building C object library/CMakeFiles/mbedcrypto.dir/threading.c.obj
[67/89] Building C object library/CMakeFiles/mbedcrypto.dir/ecp.c.obj
[68/89] Building C object library/CMakeFiles/mbedcrypto.dir/platform.c.obj
[69/89] Building C object library/CMakeFiles/mbedcrypto.dir/sha256.c.obj
[70/89] Building C object library/CMakeFiles/mbedcrypto.dir/pkwrite.c.obj
[71/89] Building C object library/CMakeFiles/mbedcrypto.dir/sha512.c.obj
[72/89] Building C object library/CMakeFiles/mbedcrypto.dir/sha1.c.obj
[73/89] Building C object library/CMakeFiles/mbedcrypto.dir/poly1305.c.obj
[74/89] Building C object library/CMakeFiles/mbedcrypto.dir/pkparse.c.obj
[75/89] Building C object library/CMakeFiles/mbedcrypto.dir/rsa.c.obj
[76/89] Building C object library/CMakeFiles/mbedcrypto.dir/timing.c.obj
[77/89] Building C object library/CMakeFiles/mbedcrypto.dir/psa_crypto.c.obj
ninja: build stopped: subcommand failed.
[31/128] Performing install step for 'EP_openldap'
[32/128] Performing configure step for 'EP_speex'
...
-- Performing Test VAR_ARRAYS - Success
-- Performing Test HAS_ALLOCA
-- Performing Test HAS_ALLOCA - Success
-- Performing Test HAS_SSE
-- Performing Test HAS_SSE - Failed
-- Performing Test HAS_VISIBILITY
-- Performing Test HAS_VISIBILITY - Success
...
C:/e/linphone-sdk/external/jsoncpp/src/lib_json/json_reader.cpp:756:34: warning: 'Reader' is deprecated: Use CharReader and CharReaderBuilder instead. [-Wdeprecated-declarations]
  756 | Reader::Char Reader::getNextChar() {
      |                                  ^
In file included from C:/e/linphone-sdk/external/jsoncpp/src/lib_json/json_reader.cpp:10:
C:/e/linphone-sdk/external/jsoncpp/include/json/reader.h:37:63: note: declared here
   37 |     "Use CharReader and CharReaderBuilder instead.") JSON_API Reader {
      |                                                               ^~~~~~
C:/e/linphone-sdk/external/jsoncpp/src/lib_json/json_reader.cpp:810:21: warning: 'Reader' is deprecated: Use CharReader and CharReaderBuilder instead. [-Wdeprecated-declarations]
  810 | std::vector<Reader::StructuredError> Reader::getStructuredErrors() const {
      |                     ^~~~~~~~~~~~~~~
In file included from C:/e/linphone-sdk/external/jsoncpp/src/lib_json/json_reader.cpp:10:
C:/e/linphone-sdk/external/jsoncpp/include/json/reader.h:37:63: note: declared here
   37 |     "Use CharReader and CharReaderBuilder instead.") JSON_API Reader {
      |                                                               ^~~~~~
[10/11] Linking CXX static library lib\libjsoncpp.a
[11/11] Linking CXX shared library bin\libjsoncpp.dll
[34/128] Performing build step for 'EP_sqlite3'
[1/2] Building C object CMakeFiles/sqlite3.dir/sqlite3.c.obj
[2/2] Linking C shared library libsqlite3.dll
ninja: build stopped: subcommand failed.
ninja: build stopped: subcommand failed.

It seems that the real error is this:

error: missing binary operator before token "("

I'm not sure what is the cause of the error message:

error: missing binary operator before token "("

Here What does the compiler error "missing binary operator before token" mean? is some definition about the error, but I'm not sure why the error happens. Does it happen only in the specific environment??


Solution

  • When I configured my environment according to the https://gitlab.linphone.org/BC/public/linphone-sdk/ page and used the Developer Command Prompt for VS 2017 the build seems to go through.