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

Feature: Build for windows #85

Open
1 task done
mounte opened this issue Feb 28, 2025 · 2 comments · May be fixed by #86
Open
1 task done

Feature: Build for windows #85

mounte opened this issue Feb 28, 2025 · 2 comments · May be fixed by #86
Assignees
Labels
enhancement New feature or request

Comments

@mounte
Copy link

mounte commented Feb 28, 2025

Current problem

Currently this is not easily built on windows (I have not yet succeded at least.) Adding windows build instructions and potentially CMakePreset that sets necessary flags if needed would be welcomed.

Possible solution

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mounte mounte added the enhancement New feature or request label Feb 28, 2025
@atimin
Copy link
Member

atimin commented Feb 28, 2025

Hi @mounte , doesn't this example work for you? https://www.reduct.store/docs/next/getting-started/with-cpp#installing-the-c-sdk . Could you provide logs so I can help you quickly and update the documentation?

@atimin atimin self-assigned this Feb 28, 2025
@mounte
Copy link
Author

mounte commented Feb 28, 2025

Out of the box following

cmake -S . -B build -DREDUCT_CPP_USE_STD_CHRONO=ON

results in:

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.26100.
-- The C compiler identification is MSVC 19.42.34436.0
-- The CXX compiler identification is MSVC 19.42.34436.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Version 1.14.0
CMake Error at cmake/InstallDependencies.cmake:3 (find_package):
  By not providing "Findfmt.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "fmt", but
  CMake did not find one.

  Could not find a package configuration file provided by "fmt" with any of
  the following names:

    fmtConfig.cmake
    fmt-config.cmake

  Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
  to a directory containing one of the above files.  If "fmt" provides a
  separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:23 (include)

This is with conan executable being found. If I on the other hand force it to not find conan

 cmake -S . -B build -DREDUCT_CPP_USE_STD_CHRONO=ON  -DCONAN_CMD=""

it can generate the project files... but when building it fails due to openssl

MSBuild version 17.12.12+1cce77968 for .NET Framework

  1>Checking Build System
  Building Custom Rule D:/projects/redux/build/_deps/fmt-src/CMakeLists.txt
  format.cc
  os.cc
  Generating Code...
  fmt.vcxproj -> D:\projects\redux\build\_deps\fmt-build\Release\fmt.lib
  Building Custom Rule D:/projects/redux/src/CMakeLists.txt
cl : command line  warning D9002: ignoring unknown option '-fPIC' [D:\projects\redux\build\src\reductcpp.vcxproj]
  http_client.cc
  serialisation.cc
D:\projects\redux\build\_deps\httplib-src\httplib.h(260,10): error C1083: Cannot open include file: 'openssl/err.h': No such file or directory [D:\projects\redux\build\src\reductcpp.vcxproj]
  (compiling source file '../../src/reduct/internal/http_client.cc')

  bucket.cc
  client.cc
  error.cc
  Generating Code...

So there is the openssl issue, I usually rely on the vcpkg deps for openssl, so not sure what the intended way here is to find a good inclusion of the openssl lib.
By installing from: https://slproweb.com/products/Win32OpenSSL.html (it installs to: C:\Program Files\OpenSSL-Win64 )
actually makes it build (openssl needs to be installed before configuring the project)

So I guess the roadblocker I hit was that cmake did not complain, there should probably be a find_package openssl required?

Then there is this warning:
cl : command line warning D9002: ignoring unknown option '-fPIC'

I think what should be used is:
set_property(TARGET thelib PROPERTY POSITION_INDEPENDENT_CODE ON)
which as far as I recall sets the right flag for compiler/linker.

@atimin atimin linked a pull request Mar 1, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants