You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
I was unable to compile libsignal-protocol-c using Visual Studio, either with the IDE or the default console compiler msvc.
Steps to reproduce
Open PowerShell or Developer Command Prompt for VS 2019
Go to the repo's folder, create a folder for the build and open it
run cmake ..
run cmake --build .
Actual result:
I get the following errors:
C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\src\curve25519\ed25519\tests\internal_fast_tests.c(300,28): erro
r C2057: expected constant expression [C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\myOwnBuild\src\curve2551
9\curve25519.vcxproj]
C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\src\curve25519\ed25519\tests\internal_fast_tests.c(300,28): erro r C2466: cannot allocate an array of constant size 0 [C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\myOwnBuil d\src\curve25519\curve25519.vcxproj]
C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\src\curve25519\ed25519\tests\internal_fast_tests.c(300,29): erro r C2133: 'msg': unknown size [C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\myOwnBuild\src\curve25519\curve25 519.vcxproj]
C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\src\curve25519\ed25519\tests\internal_fast_tests.c(340,28): erro r C2057: expected constant expression [C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\myOwnBuild\src\curve2551 9\curve25519.vcxproj]
C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\src\curve25519\ed25519\tests\internal_fast_tests.c(340,28): erro r C2466: cannot allocate an array of constant size 0 [C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\myOwnBuil d\src\curve25519\curve25519.vcxproj]
C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\src\curve25519\ed25519\tests\internal_fast_tests.c(340,29): erro
r C2133: 'msg': unknown size [C:\Users\Unable to decrypt\Documents\Git\libsignal-protocol-c\myOwnBuild\src\curve25519\curve25
519.vcxproj]
Expected result:
I expect to generate signal-protocol-c.lib
Device info
Device: Toshiba (DESKTOP-PKJM3FE) Windows 10 Home 64 bits Signal version: 2.3.2
Link to logs
It seems like msvc doesn't fully support standard c99 which leads to errors in the following code:
const int MSG_LEN = 200;
unsigned char msg[MSG_LEN];
It also doesn't identify #ifndef _WINDOWS so it always ends up trying to include unistd.h.
Note MSVC appears to only support this syntax when compiling a C++ application. I have tried targeting C11 standard with compiler flags using CMake and it still fails. I have not determined the root cause of the parsing/compilation bug using VS2019 either but have a similar work around stashed for when I need to build on Windows.
I have:
Bug description
I was unable to compile libsignal-protocol-c using Visual Studio, either with the IDE or the default console compiler msvc.
Steps to reproduce
cmake ..
cmake --build .
Actual result:
I get the following errors:
Expected result:
I expect to generate
signal-protocol-c.lib
Device info
Device: Toshiba (DESKTOP-PKJM3FE) Windows 10 Home 64 bits
Signal version: 2.3.2
Link to logs
It seems like msvc doesn't fully support standard c99 which leads to errors in the following code:
It also doesn't identify
#ifndef _WINDOWS
so it always ends up trying to includeunistd.h
.I have a workaround, changes can be seen here Hirobreak@2721ea8.
Which works for me as of now. I did a little research to make my workaround a solution but I've found none yet
The text was updated successfully, but these errors were encountered: