Skip to content

NO-JIRA: Buld Fixes for Visual Studio /ANALYZE, OpenSSL Build on Windows - #451

Open
hoyhoy wants to merge 2 commits into
apache:mainfrom
hoyhoy:zos-and-windows-openssl-fixes
Open

hoyhoy wants to merge 2 commits into
apache:mainfrom
hoyhoy:zos-and-windows-openssl-fixes

Conversation

@hoyhoy

@hoyhoy hoyhoy commented Aug 20, 2026 •

Copy link
Copy Markdown

Build fixes for OpenSSL using MSVC (22/26) and z/OS.

@hoyhoy hoyhoy changed the title NO-JIRA: Buld Fixes for Visual Studio /ANALYZE, OpenSSL Build on Windows and zOS CMake fixes. NO-JIRA: Buld Fixes for Visual Studio /ANALYZE, OpenSSL Build on Windows and z/OS CMake fixes. Aug 21, 2026
@hoyhoy hoyhoy changed the title NO-JIRA: Buld Fixes for Visual Studio /ANALYZE, OpenSSL Build on Windows and z/OS CMake fixes. NO-JIRA: Buld Fixes for Visual Studio /ANALYZE, OpenSSL Build on Windows Sep 3, 2026
@astitcher

Copy link
Copy Markdown
Member

Since this was raised I've made some of the changes in this PR to main. I'd like some explanation of the reason for the change in the library initialization - it just seems to be a slightly more elaborate vesion of the same code perhaps with better error reporting (but maybe that error reporting should be in the common code anyway). Also I'm unclear why you need to add the crypto library to the link - I can see on Linux/MacOS that the crypto library is linked.

@hoyhoy

hoyhoy commented Oct 6, 2026 •

Copy link
Copy Markdown
Author

Since this was raised I've made some of the changes in this PR to main. I'd like some explanation of the reason for the change in the library initialization.

When building with OpenSSL on Windows, InitOnceExecuteOnce() needs a matching prototype for initialize(). That's why I wrapped the function with unused parameters.

Also, the initialization can fail. So you definitely want to log the errors if possible...

I just tried with main and it did build on zOS, but not Windows with OpenSSL.

c/CMakeFiles/qpid-proton-core-objects.dir/src/ssl/openssl.c.obj 
23:02:52  [cmake-build] C:\PROGRA~1\MICROS~3\2022\PROFES~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\cl.exe  /nologo -D_WIN32_WINNT=0x0601 -Dqpid_proton_core_EXPORTS -IC:\ci\obj\qpid-proton\c\include -IC:\ci\obj\qpid-proton\c\src -IC:\ci\obj\qpid-proton\build\c\include -IC:\ci\obj\qpid-proton\build\c\src -external:IC:\ci\obj\stage\openssl\include -external:W0 /DWIN32 /D_WINDOWS  /O2 /Ob2 /DNDEBUG -MD /GL /WX /W4 /analyze /wd26812 /wd4090 /wd4100 /wd4127 /wd4133 /wd4180 /wd4189 /wd4211 /wd4232 /wd4244 /wd4245 /wd4267 /wd4305 /wd4389 /wd4456 /wd4458 /wd4459 /wd4505 /wd4701 /wd4702 /wd4703 /wd4706 /wd4800 /wd4996 /wd6001 /wd6011 /wd6031 /wd6101 /wd6217 /wd6221 /wd6230 /wd6244 /wd6246 /wd6308 /wd6336 /wd6385 /wd6386 /wd6387 /wd6553 /we26819 /we28251 /we6328 /we6340 /showIncludes /Foc\CMakeFiles\qpid-proton-core-objects.dir\src\ssl\openssl.c.obj /Fdc\CMakeFiles\qpid-proton-core-objects.dir\ /FS -c C:\ci\obj\qpid-proton\c\src\ssl\openssl.c
23:02:52  [cmake-build] C:\ci\obj\qpid-proton\c\src\ssl\openssl.c(1690): error C2065: 'initialize': undeclared identifier
23:02:54  [cmake-build] C:\ci\obj\qpid-proton\c\src\ssl\openssl.c(1690): warning C4047: 'function': 'PINIT_ONCE_FN' differs in levels of indirection from 'int *'
23:02:54  [cmake-build] C:\ci\obj\qpid-proton\c\src\ssl\openssl.c(1690): warning C4024: 'InitOnceExecuteOnce': different types for formal and actual parameter 2
23:02:54  [cmake-build] [56/120] (6.800 sec elapsed) Active jobs: 9.Building C object c\CMakeFiles\qpid-proton.dir\src\messenger\transform.c.obj
23:02:54  [cmake-build] [57/120] (7.294 sec elapsed) Active jobs: 8.Building C object c\CMakeFiles\qpid-proton.dir\src\messenger\store.c.obj
23:03:00  [cmake-build] [58/120] (7.934 sec elapsed) Active jobs: 7.Building C object c\CMakeFiles\qpid-proton.dir\src\messenger\messenger.c.obj
23:03:00  [cmake-build] [59/120] (8.111 sec elapsed) Active jobs: 6.Building C object c\CMakeFiles\qpid-proton-core-objects.dir\src\compiler\msvc\start.c.obj
23:03:00  [cmake-build] [60/120] (10.987 sec elapsed) Active jobs: 5.Building CXX object cpp\CMakeFiles\qpid-proton-cpp.dir\src\map.cpp.obj
23:03:00  [cmake-build] [61/120] (12.992 sec elapsed) Active jobs: 4.Building CXX object c\CMakeFiles\qpid-proton-proactor-objects.dir\src\proactor\win_iocp.cpp.obj
23:03:00  [cmake-build] [62/120] (13.936 sec elapsed) Active jobs: 3.Building CXX object cpp\CMakeFiles\qpid-proton-cpp.dir\src\connection.cpp.obj
23:03:00  [cmake-build] [63/120] (13.956 sec elapsed) Active jobs: 2.Building CXX object cpp\CMakeFiles\qpid-proton-cpp.dir\src\byte_array.cpp.obj
23:03:00  [cmake-build] [64/120] (13.990 sec elapsed) Active jobs: 1.Building CXX object cpp\CMakeFiles\qpid-proton-cpp.dir\src\binary.cpp.obj
23:03:00  [cmake-build] ninja: build stopped: subcommand failed.

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

Successfully merging this pull request may close these issues.

2 participants