-
Notifications
You must be signed in to change notification settings - Fork 71
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
error when compiling oqs-provider in windows Using msys2 and mingw32 #105
Comments
That is not entirely unexpected as Windows is not yet supported (see #47). If you see a need for support of that platform, please let us know. Any contribution by you will be welcome. |
See open-quantum-safe/liboqs#1371 (comment). Same here. #47 will first be resolved with cygwin support. |
my gcc version is : |
my apology about that. There is an error about the index() function in visual studio too. the index function is in the strings.h in GNU c library in ubuntu but in the mingw32 strings.h does not have this function. |
Last year I was under the impression that this project had/has never been tested (properly or at all) on Mac & Windows. On another note, we should not confuse environments (e.g. cygwin, MSYS, etc). Based on the issue reported here, I suspect a broken environment and/or lack of experience (e.g. fresher?). We built this project last year from source. We could try again now. |
Fully agreed with all your statements, @mingw-io , Thanks -- also for detailing Windows-specific build issues. When looking into #47 again I again already stumbled building "plain" openssl in a cygwin environment (compile errors of an apparent Microsoft crypto include file), so hints very welcome how to correctly build. My ultimate goal would be an AppVeyor script to test all components using MSVC, cygwin, msys2/mingw. |
I could build this project on windows with mingw64. However, the tests were skipped in the building process but creating PQC certificates and running a test client and server still works for me. For the step "Building the provider", likewise as @k-Artin mentioned, I used
Lastly, I added the file
Hopefully, cmake will build after the adjustments. It took me a long time to figure out how to build this and I received help from others. Hope this works for @k-Artin as well. |
@VeronikaNguyen Thanks very much for sharing all this! Would you consider contributing this to the project via PR (such as to ease the life of others)? Otherwise, I guess it'd be OK for you if I'd add things as per the above? |
@baentsch No problem, I am glad this project exists. Sure, I will create a PR for this. This is not a silly question. I am not sure if mingw64 comes with openssl but since I wanted to use TLS with PQC signatures, I build openssl3 from https://github.com/baentsch/openssl/tree/sigload in mingw64 as well. |
FWIW, I now checked that building & testing |
As #192 landed, we now have CI building and testing |
Closing due to inactivityt. Build on |
hello
I am getting the following errors when I install oqs-provider on windows with mingw32.
$ ninja -j 4
[11/28] Building C object test/CMakeFiles/oqs_test_signatures.dir/test_common.c.obj
C:/msys64/home/oqs-provider/oqs-provider-main/test/test_common.c: In function 'alg_is_enabled':
C:/msys64/home/oqs-provider/oqs-provider-main/test/test_common.c:27:20: warning: implicit declaration of function 'index' [-Wimplicit-function-declarat
ion]
27 | while((comma = index(alglist, ','))) {
| ^~~~~
C:/msys64/home/oqs-provider/oqs-provider-main/test/test_common.c:27:20: warning: incompatible implicit declaration of built-in function 'index' [-Wbuil
tin-declaration-mismatch]
[13/28] Building C object test/CMakeFiles/oqs_test_kems.dir/test_common.c.obj
C:/msys64/home/oqs-provider/oqs-provider-main/test/test_common.c: In function 'alg_is_enabled':
C:/msys64/home/oqs-provider/oqs-provider-main/test/test_common.c:27:20: warning: implicit declaration of function 'index' [-Wimplicit-function-declarat
ion]
27 | while((comma = index(alglist, ','))) {
| ^~~~~
C:/msys64/home/oqs-provider/oqs-provider-main/test/test_common.c:27:20: warning: incompatible implicit declaration of built-in function 'index' [-Wbuil
tin-declaration-mismatch]
[14/28] Linking C executable test\oqs_test_signatures.exe
FAILED: test/oqs_test_signatures.exe
cmd.exe /C "cd . && C:\msys64\mingw32\bin\gcc.exe test/CMakeFiles/oqs_test_signatures.dir/oqs_test_signatures.c.obj test/CMakeFiles/oqs_test_sig
natures.dir/test_common.c.obj -o test\oqs_test_signatures.exe -Wl,--out-implib,test\liboqs_test_signatures.dll.a -Wl,--major-image-version,0,--min
or-image-version,0 C:/openvpn3/lib/libcrypto.dll.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvap
i32 && cd ."
C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.2.0/../../../../i686-w64-mingw32/bin/ld.exe: test/CMakeFiles/oqs_test_signatures.dir/test_com
mon.c.obj:test_common.c:(.text+0x165): undefined reference to **
index'** collect2.exe: error: ld returned 1 exit status [15/28] Linking C executable test\oqs_test_kems.exe FAILED: test/oqs_test_kems.exe cmd.exe /C "cd . && C:\msys64\mingw32\bin\gcc.exe test/CMakeFiles/oqs_test_kems.dir/oqs_test_kems.c.obj test/CMakeFiles/oqs_test_kems.dir/test_c ommon.c.obj -o test\oqs_test_kems.exe -Wl,--out-implib,test\liboqs_test_kems.dll.a -Wl,--major-image-version,0,--minor-image-version,0 C:/openvpn 3/lib/libcrypto.dll.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ." C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/12.2.0/../../../../i686-w64-mingw32/bin/ld.exe: test/CMakeFiles/oqs_test_kems.dir/test_common.c. obj:test_common.c:(.text+0x165): undefined reference to
index'collect2.exe: error: ld returned 1 exit status
[17/28] Building C object oqsprov/CMakeFiles/oqsprovider.dir/oqs_encode_key2any.c.obj
ninja: build stopped: subcommand failed.
this error is in the mingw32.
This error is due to the index() function. Is it possible to use strchr instead of this function?
when using visual studio this error does not exist and the following error occurs:
fatal error: 'stdatomic.h' file not found.
i think something wrong.
Thank you in advance!
The text was updated successfully, but these errors were encountered: