aws-samples / aws-iot-securetunneling-localproxy

AWS Iot Secure Tunneling local proxy reference C++ implementation
https://docs.aws.amazon.com/iot/latest/developerguide/what-is-secure-tunneling.html
Apache License 2.0
73 stars 69 forks source link

Errors in building localproxy on Windows #133

Closed harikiran27 closed 2 months ago

harikiran27 commented 1 year ago

Describe the bug

Unable to build localproxy on Windows 10. Getting LNK2019 and LNK2001 errors when I run the final msbuild command.

To Reproduce

Steps to reproduce the behavior:

  1. install zlib, protobuf (3.17), catch2 and openssl (1.1.1u) as per the documentation
  2. install boost(1.81.0) using .\b2 toolset=msvc address-model=64 install define=BOOST_WINAPI_VERSION_WIN10
  3. run cmake -DWIN32_WINNT=0x0A00 -DBoost_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH="C:\Boost;C:\Program Files (x86)\Catch2;C:\Program Files (x86)\protobuf;C:\Program Files\OpenSSL" -G "Visual Studio 16 2019" -A x64 ..\ in aws-iot-securetunneling-localproxy\build folder
  4. run msbuild localproxy.vcxproj -p:Configuration=Release

Expected behavior

Expected successful localproxy build

Actual behavior

Encountered LNK2019 and LNK2001 errors

Logs console output of step 3 : image

console output of step 4: msbuildlog.txt

Environment (please complete the following information):

Additional context

I also tried using -DWIN32_WINNT=_WIN32_WINNT_WIN10, but got more errors alongwith LNK2038.

Any help is appreciated.

HarshGandhi-AWS commented 1 year ago

Hello @harikiran27 , thank you for reaching out to us with this issue. Please be patient with us until we reproduce this issue and resolve the bug if present. To unblock yourself for now, I would suggest you to run local proxy on a docker container. Here is the list of few local proxy container images which you can use.

-Harsh Gandhi

joenghoyin commented 1 year ago

Hi @HarshGandhi-AWS, I am running into the same problem when trying to build localproxy for Windows. Can the AWS team replicate this bug?

arunsabat commented 1 year ago

i am also struck with latest localproxy with boost 1.81 in windows build. Can AWS team quickly look into it?

gerbit commented 9 months ago

Any progress on this one?

EDIT:

Boost build which was helped to me:

b2 -j 16 --stagedir=stage/x64 toolset=msvc --build-type=complete address-model=64 architecture=x86 install define=_WIN32_WINNT=0x0A00 define=BOOST_WINAPI_VERSION_WIN10

abeytr commented 9 months ago

I am also facing build errors while compiling localproxy in a windows OS with Boost 1.81. Request you to look into this asap. I have attached the console output that describes the build errors. localProxy-WindowsBuild.txt

RogerZhongAWS commented 8 months ago

Hey folks, I have tried building every boost library since 1.76 and found that from 1.77 to 1.78, there was a regression in the boost.log library which means we have to set _WIN32_WINNT macro to windows 7 (0x0601) and the BOOST_USE_WINAPI_VERSION macro to windows 7

More details about the issue can be found in this thread here: https://github.com/microsoft/vcpkg/issues/22495

To fix, please reference the changes in this PR https://github.com/aws-samples/aws-iot-securetunneling-localproxy/pull/144 and rebuild. If you do not want to build from source, unofficial binaries produced by the github workflow can be downloaded with boost statically linked. You will still need OpenSSL as a shared library.

RogerZhongAWS commented 2 months ago

have not heard back on this issue, assuming resolved as its it working in our windows build environment