-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unresolved External Symbols when using Static Libraries #2734
Comments
Not sure if this is your problem, but it looks like you're missing a cmake "..\aws-sdk-cpp" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:/Program Files (x86)/aws-cpp-sdk-all" -DFORCE_SHARED_CRT=OFF -DBUILD_SHARED_LIBS=OFF Also note that you probably want to use |
What does the CMakeLists.txt look like? |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
Hi jmklix! Thank you for catching that missing hyphen. I made sure to run through the steps again from the beginning, making sure the hyphen was in there and I was only building S3, but I still am seeing the prior linker errors. I also do briefly see an error pop up when I cmake the "..\aws-sdk-cpp" folder, not sure what is happening there: As to what my CMakeLists.txt looks like (and I assume you aren't referring to the ones in "sdk_build"), I was hoping to do this all through a Visual Studio project without a CMakeLists.txt (as I had done that successfully with the Debug version of the AWS SDK). I am using a framework on top of C++ (JUCE), so if there is a way to do this directly in .vcxproj arguments, that would be awesome! I did attempt to do this CMakeLists, which looks like below (following https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/build-cmake.html); I'm not sure what parts I should be replacing with my own arguments:
After including the statiic .libs in the same folder and running cmake from terminal, I see this error: Thank you for your time! |
If you are looking to do this in visual studio you might want to try using the vcpkg. You can find the steps for how to do this with this sdk here. For further questions about using vcpkg look here. To use this sdk with JUCE I would check out using the forms here to see how others have done it Or you can try to build the sdk and your project with cmake. This is what I have the most experience with and want I can help you the most with. I noticed another error in my previous comment which I forgot to correct. Make sure you are using |
I'm glad I was able to help you. If you run into any other problems it's better if you open a new issue/discussion. Closing this issue for now, but please let me know if you have any other problems |
|
I had same problem with link functions from static libraries. |
Describe the bug
Hi there! I'm currently trying to build static, release libraries for C++ code, and I'm running into linker errors. I provided the sample code and reproduction steps below (the basic AWS initialization, and how I make the libraries).
Unsure what I'm missing here, but I'm guessing I need to fill another field with where the static libraries are. Thank you for the help!
Expected Behavior
I expect the code to build and run without linker errors.
Current Behavior
I am getting linker errors for my libraries, as shown below:
Reproduction Steps
To get the static libraries needed for this, I did the following steps:
Get CMake 3.21.7 and add to PATH
C:\Users\Jason > git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
2.5 C:\Users\Jason > git submodule update --init --recursive
C:\Users\Jason > mkdir sdk_build
C:\Users\Jason > cd sdk_build
C:\Users\Jason\sdk_build > cmake "..\aws-sdk-cpp" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:/Program Files (x86)/aws-cpp-sdk-all" DFORCE_SHARED_CRT=OFF -DBUILD_SHARED_LIBS=OFF
C:\Users\Jason\sdk_build > cmake --build . --config=Release
C:\Users\Jason\sdk_build > cmake --install . --config=Release
In Visual Studio, add "C:\Program Files (x86)\aws-cpp-sdk-all\include" to Release Configuration: Additional Include Directories
In Visual Studio, add "aws-cpp-sdk-core.lib;aws-cpp-sdk-s3.lib;aws-c-auth.lib;aws-c-cal.lib;aws-c-common.lib;aws-c-compression.lib;aws-c-event-stream.lib;aws-checksums.lib;aws-c-http.lib;aws-c-io.lib;aws-c-mqtt.lib;aws-crt-cpp.lib;aws-c-s3.lib;aws-c-sdkutils.lib;aws-cpp-sdk-lambda.lib;%(AdditionalDependencies)" to Release Configuration: Additional Dependencies
Add the project folder under Release Configuration: Additional Library Directories to get static libraries.
Copy above libs and corresponding dependencies and add them to the project folder (next to main.cpp)
Build and run in Release mode.
Possible Solution
No response
Additional Information/Context
No response
AWS CPP SDK version used
Latest (1.11.162)
Compiler and Version used
Visual Studio 17 2022
Operating System and version
Windows 10, Version 22H2
The text was updated successfully, but these errors were encountered: