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

Unable to locate binaries when building "Hello S3" app #2576

Closed
ShimYama opened this issue Jul 13, 2023 · 8 comments · Fixed by #2586
Closed

Unable to locate binaries when building "Hello S3" app #2576

ShimYama opened this issue Jul 13, 2023 · 8 comments · Fixed by #2586
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@ShimYama
Copy link
Contributor

Describe the bug

I'm setting up aws-sdk-cpp following the instruction in this page and tried to build "Hello S3" sample app.
But build stops finding sdk libraries.

Expected Behavior

Build "Hello S3" app.

Current Behavior

cmake generates this error message and stop building.

   AWS SDK for C++ headers found, but we were unable to locate the binaries.
   Have you deleted or moved it?
 
   Please make sure header files and binaries are located in INSTALL_ROOT_DIR/INCLUDE_DIR/ and
   INSTALL_ROOT_DIR/LIB_DIR/[PLATFORM_PREFIX]/[Debug|Config|OtherConfigs]

Reproduction Steps

I cloned git repository and made build directory outside of git folder.
I run these commands and complete installing sdk to C:/Program Files/aws-cpp-sdk-all.

cmake ..\aws-sdk-cpp -G "Visual Studio 14 Win64" -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="s3;mediastore" -DENABLE_TESTING=OFF
msbuild INSTALL.vcxproj /p:Configuration=Release

I created main.cpp and CMakeLists.txt that is copied from "Hello S3" page but amended CMAKE_BUILD_TYPE to Release and run this command.

cmake . -G "Visual Studio 14 Win64"

Possible Solution

No response

Additional Information/Context

I add -DCMAKE_FIND_DEBUG_MODE=1 flag to build command for "Sample S3" app and got those lines.

CMake Debug Log at C:/Program Files/aws-cpp-sdk-all/lib/cmake/AWSSDK/AWSSDKConfig.cmake:112 (find_library):
  find_library called with the following settings:

    VAR: AWSSDK_CORE_LIB_FILE
    NAMES: "aws-cpp-sdk-core"
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  find_library considered the following locations:

    C:/Program Files/aws-cpp-sdk-all/lib/()aws-cpp-sdk-core(\.lib)
    C:/Program Files/aws-cpp-sdk-all/lib/Debug/()aws-cpp-sdk-core(\.lib)
    C:/Program Files/aws-cpp-sdk-all/lib/DebugOpt/()aws-cpp-sdk-core(\.lib)
    C:/Program Files/aws-cpp-sdk-all/lib/Release/()aws-cpp-sdk-core(\.lib)
    C:/Program Files/aws-cpp-sdk-all/lib/RelWithDebInfo/()aws-cpp-sdk-core(\.lib)
    C:/Program Files/aws-cpp-sdk-all/lib/MinSizeRel/()aws-cpp-sdk-core(\.lib)

  The item was not found.

It seems that cmake trying to find aws-cpp-sdk-core.lib in aws-cpp-sdk-all/lib directory but it is located in aws-cpp-sdk-all/bin.

I checked C:\Program Files\aws-cpp-sdk-all\lib\cmake\AWSSDK\AWSSDKConfig.cmake and found these lines. (Lines 112-119)

find_library(AWSSDK_CORE_LIB_FILE aws-cpp-sdk-core
        "${AWSSDK_ROOT_DIR}/${AWSSDK_INSTALL_LIBDIR}/${AWSSDK_PLATFORM_PREFIX}"
        "${AWSSDK_ROOT_DIR}/${AWSSDK_INSTALL_LIBDIR}/${AWSSDK_PLATFORM_PREFIX}/Debug"
        "${AWSSDK_ROOT_DIR}/${AWSSDK_INSTALL_LIBDIR}/${AWSSDK_PLATFORM_PREFIX}/DebugOpt"
        "${AWSSDK_ROOT_DIR}/${AWSSDK_INSTALL_LIBDIR}/${AWSSDK_PLATFORM_PREFIX}/Release"
        "${AWSSDK_ROOT_DIR}/${AWSSDK_INSTALL_LIBDIR}/${AWSSDK_PLATFORM_PREFIX}/RelWithDebInfo"
        "${AWSSDK_ROOT_DIR}/${AWSSDK_INSTALL_LIBDIR}/${AWSSDK_PLATFORM_PREFIX}/MinSizeRel"
        NO_DEFAULT_PATH)

And I replaced ${AWSSDK_INSTALL_LIBDIR} with ${AWSSDK_INSTALL_BINDIR}, but another error occurs.
Here's a log.

CMake Debug Log at C:/Program Files/aws-cpp-sdk-all/lib/cmake/AWSSDK/AWSSDKConfig.cmake:188 (find_library):
  find_library called with the following settings:

    VAR: LIB_PATH
    NAMES: "aws-cpp-sdk-core"
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  find_library considered the following locations:

    C:/Program Files/aws-cpp-sdk-all/lib/()aws-cpp-sdk-core(\.dll)

  The item was not found.

Call Stack (most recent call first):
  CMakeLists.txt:35 (AWSSDK_CPY_DYN_LIBS)


CMake Debug Log at C:/Program Files/aws-cpp-sdk-all/lib/cmake/AWSSDK/AWSSDKConfig.cmake:190 (find_library):
  find_library called with the following settings:

    VAR: LIB_PATH
    NAMES: "core"
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  find_library considered the following locations:

    C:/Program Files/aws-cpp-sdk-all/lib/()core(\.dll)

  The item was not found.

Call Stack (most recent call first):
  CMakeLists.txt:35 (AWSSDK_CPY_DYN_LIBS)


CMake Error at C:/Program Files/aws-cpp-sdk-all/lib/cmake/AWSSDK/AWSSDKConfig.cmake:192 (message):
  Couldn't find library aws-cpp-sdk-core or core
Call Stack (most recent call first):
  CMakeLists.txt:35 (AWSSDK_CPY_DYN_LIBS)

It seems that cmake trying to find aws-cpp-sdk-core.dll in aws-cpp-sdk-all/lib directory but it is located in aws-cpp-sdk-all/bin too.

AWS CPP SDK version used

1.11.117

Compiler and Version used

Visual Studio 2015 Community / Build Engine version 14.0.25420.1

Operating System and version

Windows 10 Pro 22H2

@ShimYama ShimYama added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 13, 2023
@jmklix jmklix changed the title Unable to localte binaries when building "Hello S3" app Unable to locate binaries when building "Hello S3" app Jul 13, 2023
@jmklix jmklix self-assigned this Jul 17, 2023
@jmklix jmklix added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Jul 17, 2023
@CrackedDS
Copy link

Hi,
Glad to see someone is investigating this.
This doesn't just happen with the "hello s3" app but with any cmake project. Looks like the AWSSDK_CORE_LIB_FILE:FILEPATH is not being set when finding the core library during cmake.

@jmklix
Copy link
Member

jmklix commented Jul 18, 2023

Can you try using the updated build instructions found here
Your commands should look like this:

   cmake ..\aws-sdk-cpp -DCMAKE_BUILD_TYPE=Debug -DBUILD_ONLY="s3;mediastore" -DENABLE_TESTING=OFF
   cmake --build . --config=Debug
   cmake --install . --config=Debug

@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. p3 This is a minor priority issue and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jul 18, 2023
@ShimYama
Copy link
Contributor Author

ShimYama commented Jul 18, 2023

Thank you for your reply.
However I tested those commands but nothing changed.
I got the same error message when I tried to build "Hello S3" app.

@jmklix jmklix added p2 This is a standard priority issue investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. p3 This is a minor priority issue labels Jul 18, 2023
@jmklix
Copy link
Member

jmklix commented Jul 19, 2023

It looks like some of the files are not being put in the correct folder when this sdk is being installed on Windows. Working on a fix for this. But as temporary workaround is to manually move the files yourself. The default install location for this sdk is \Program Files (x86)\aws-cpp-sdk-all. You should see three sub-folders inside aws-cpp-sdk-all: bin, include, and lib. Copy all of the files from bin into lib and then try building the sample s3 application. Please let me know if you have any more questions about this.

@ShimYama
Copy link
Contributor Author

ShimYama commented Jul 19, 2023

After copying all files in bin directory into lib folder, I can finally build the sample app, thank you very much! Now I can start my project.

@jmklix
Copy link
Member

jmklix commented Jul 20, 2023

Glad to hear that works for you now. This should be permanently fixed with this PR. Updating to the latest version of the sdk should fix this for you. Please let me know if you still have any problems with building on Windows.

@jmklix jmklix added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jul 20, 2023
@ShimYama
Copy link
Contributor Author

No linker problem occurs after updating to the latest version (1.11.123).
Thank you very much!

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jul 21, 2023
@jmklix jmklix linked a pull request Jul 24, 2023 that will close this issue
11 tasks
@jmklix jmklix closed this as completed Jul 24, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants