Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build on win 10, vs2019 #370

Open
Andrysky opened this issue Nov 29, 2021 · 13 comments
Open

Can't build on win 10, vs2019 #370

Andrysky opened this issue Nov 29, 2021 · 13 comments

Comments

@Andrysky
Copy link

win 10, vs2019

step to reproduce

cd C:\git\github\
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
git clone --recurse-submodules git@github.com:openssl/openssl.git
cd openssl
git checkout openssl-3.0
perl Configure VC-WIN64A
nmake
nmake test
cd gost-engine
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=C:\git\github\openssl\ -DOPENSSL_ENGINES_DIR=C:\git\github\openssl\engines\ ..

- fail

C:\git\github\openssl\gost-engine\gost_pmeth.c(39,17): error C2220: the following warning is treated as an error [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(54,45): error C2059: syntax error: ':' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
etc

ninja also doesn't work

cd C:\git\github\openssl\gost-engine\
mkdir cmake-build-ninja
cd cmake-build-ninja
cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=C:\git\github\openssl\ -DOPENSSL_ENGINES_DIR=C:\git\github\openssl\engines\ -G=Ninja ..

CMake Error:
  Running
   'C:/PROGRA~2/MICROS~2/2019/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe' '-C' 'C:/git/github/openssl/gost-engine/cmake-build-ninja' '-t' 'recompact'
  failed with:
   ninja: error: build.ninja:876: multiple rules generate bin/gost.dll [-w dupbuild=err]
@beldmit
Copy link
Contributor

beldmit commented Nov 29, 2021

What warning, BTW?

@Andrysky
Copy link
Author

@vt-alt vt-alt changed the title Can't build Can't build on win 10, vs2019 Nov 29, 2021
@beldmit
Copy link
Contributor

beldmit commented Nov 29, 2021

OK, try commenting out the line

# pragma message "Use regular implementation"

@Andrysky
Copy link
Author

Andrysky commented Nov 29, 2021

+- the same
https://gist.github.com/Andrysky/265d8ee02ac404540ac3a61c8b308f91

about ninja and multiple rules generate bin/gost.dll
https://github.com/gost-engine/engine/blob/master/CMakeLists.txt#L335
https://github.com/gost-engine/engine/blob/master/CMakeLists.txt#L343
for what reasons the shared library is declared twice? - it's like the same thing ..

@beldmit
Copy link
Contributor

beldmit commented Nov 29, 2021

Please turn off -Werror.

@Andrysky
Copy link
Author

/WX - disabled:

C:\git\github\openssl\gost-engine\gost_md.c(54,45): error C2059: syntax error: ':' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(67,5): error C2059: syntax error: 'if' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(69,6): error C2143: syntax error: missing '{' before '->' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(69,6): error C2059: syntax error: '->' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(70,5): error C2059: syntax error: 'return' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(71,1): error C2059: syntax error: '}' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(91,22): error C2059: syntax error: ':' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(104,9): error C2059: syntax error: ':' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]C:\git\github\openssl\gost-engine\gost_crypt.c(106,5): error C2181: illegal else without matching if [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(110,60): error C2059: syntax error: ':' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(123,6): error C2143: syntax error: missing '{' before '->' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(123,6): error C2059: syntax error: '->' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(124,5): error C2059: syntax error: 'return' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(125,1): error C2059: syntax error: '}' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]

@beldmit
Copy link
Contributor

beldmit commented Nov 29, 2021

@vt-alt sorry, I don't understand this macro

#define TPL(st,field) ( \

And I'm afraid, the compiler also doesn't.

@vt-alt
Copy link
Member

vt-alt commented Nov 29, 2021

@vt-alt sorry, I don't understand this macro

#define TPL(st,field) ( \

And I'm afraid, the compiler also doesn't.

Do you mean ternary operator? Perhaps, MSVC does not understand it.

@vt-alt
Copy link
Member

vt-alt commented Nov 29, 2021

#define TPL(st,field) ( \
    ((st)->field) ?: TPL_VAL(st,field) \
)

Could be replaced with

#define TPL(st,field) ( \
    ((st)->field) ? ((st)->field) : TPL_VAL(st,field) \
)

@beldmit
Copy link
Contributor

beldmit commented Nov 29, 2021

Somewhen I need to setup the github CI scenario for Windows build...

@vt-alt
Copy link
Member

vt-alt commented Nov 29, 2021

Somewhen I need to setup the github CI scenario for Windows build...

Thought about this today too. ;)

@beldmit
Copy link
Contributor

beldmit commented Apr 8, 2023

I still don't have any access to Windows development machine. The patches are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@Andrysky @beldmit @vt-alt and others