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

Too many agruments to function 'mkdir' on Windows #430

Open
HarryLee02 opened this issue Jun 11, 2024 · 2 comments
Open

Too many agruments to function 'mkdir' on Windows #430

HarryLee02 opened this issue Jun 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@HarryLee02
Copy link

Recreate the bug
Got this error after cmake --build .

[24/28] Building C object test/CMakeFiles/oqs_test_tlssig.dir/oqs_test_tlssig.c.obj
FAILED: test/CMakeFiles/oqs_test_tlssig.dir/oqs_test_tlssig.c.obj
C:\msys64\mingw64\bin\cc.exe -DNDEBUG -ID:/Project/openssl-3.2.1/include -ID:/Project/liboqs-compiled/include -ID:/Project/liboqs-compiled/include/oqs -std=gnu11 -Wunused-function -MD -MT test/CMakeFiles/oqs_test_tlssig.dir/oqs_test_tlssig.c.obj -MF test\CMakeFiles\oqs_test_tlssig.dir\oqs_test_tlssig.c.obj.d -o test/CMakeFiles/oqs_test_tlssig.dir/oqs_test_tlssig.c.obj -c D:/Me/Study_Uni/HK4_Nam_2/slide_mmh/Labs/Project/oqs-provider/test/oqs_test_tlssig.c
D:/Project/oqs-provider/test/oqs_test_tlssig.c: In function 'test_oqs_tlssig':
D:/oqs-provider/test/oqs_test_tlssig.c:43:9: error: too many arguments to function 'mkdir'
   43 |     if (mkdir(certsdir, 0700)) {
      |         ^~~~~
In file included from C:/msys64/mingw64/include/sys/stat.h:14,
                 from D:/Project/oqs-provider/test/oqs_test_tlssig.c:13:
C:/msys64/mingw64/include/io.h:282:15: note: declared here
  282 |   int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
      |               ^~~~~
[26/28] Building C object test/CMakeFiles/oqs_test_tlssig.dir/tlstest_helpers.c.obj
ninja: build stopped: subcommand failed.

To Reproduce
Using Windows MSYS2 MINGW64 as administrator.
liboqs is built like this:

# mkdir build && cd build
# cmake -GNinja -DCMAKE_INSTALL_PREFIX=/d/Project/liboqs-compiled -DBUILD_SHARED_LIBS=ON -DOQS_USE_OPENSSL=OFF -DCMAKE_BUILD_TYPE=Release -DOQS_BUILD_ONLY_LIB=ON -DOQS_DIST_BUILD=ON ..
# ninja
# ninja install

oqs-provider is built like this:

 mkdir build && cd build
 cmake -GNinja -DCMAKE_PREFIX_PATH="D:\Project\install" -DOPENSSL_ROOT_DIR="D:\Project\openssl-3.2.1" -Dliboqs_DIR="D:\Project\liboqs-compiled\lib\cmake\liboqs" -S ..
cmake --build .

Environment (please complete the following information):

  • OS: Windows 11
  • OpenSSL version: OpenSSL 3.2.1 30 Jan 2024 (Library: OpenSSL 3.2.1 30 Jan 2024)
  • oqsprovider version: git checkout d540c28
@HarryLee02 HarryLee02 added the bug Something isn't working label Jun 11, 2024
@HarryLee02
Copy link
Author

I figured it out that mkdir() function that is specified in io.h just takes one argument, so simply change to if(mkdir(certsdir)) as mention in this stackoverflow.

This will successfully build the oqsprovider, but the size of .dll file is significantly small (625kb) and openssl doesn't recognize it even when I have edit the openssl.cnf file

@baentsch
Copy link
Member

Thanks @HarryLee02 for the report. Unfortunately, I'm not exactly a "Windows connoisseur" -- would you be willing to do a PR? Or is there another (looks unrelated) problem with

but the size of .dll file is significantly small (625kb)

So are there symbols un-resolved in the resultant .dll?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants