-
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
Undefined Reference to Aws::Transfer::TransferManager in AndroidStudio build #584
Comments
Are you able to run the aws-cpp-sdk-transfer-tests binary built in aws-cpp-sdk-transfer-tests directory without this linking problem? |
Do you mean I need to run the AndroidSDKTesting application in android and verify the linking? |
The error means that you're not linking libaws-cpp-sdk-transfer to your application. |
I am attaching a sample Android application that I have created for testing AWS Transfer using Android. To verify if the aws transfer symbols are present in the library, I have run the following command and I get the below which means the symbols are defined. Below is the linker error for reference Can anyone help with this issue? |
The problem is the order you're using to link the libs. |
Hi, I have changed the order of linkage and tried again, but I am facing the same issue.
If it was linker error for the libraries, I should have got an undefined reference for the constructor TransferManager too. But I am getting it only for the APIs such as UploadFile, DownloadFile etc. Any other inputs? |
Is this an issue related to compiling 32-bit or 64-bit libraries? |
Unresolved symbols is a runtime error. Mostly triggered by libs not found. Since you dynamically linked to these libs. Are you sure the path of these libs is in loader's search list? |
Hello, |
Can you comment out all aws related code but construct of transfer manager to verify that the lib is actually linked but the Upload and Download symbols can't be found |
I have linked the latest libraries and modified my code to create shared pointer of Transfer Manager using TransferManager::Create API . This is not giving any linking error during compilation. |
The error msg is but nm output Looks like extern "C" affected the name of functions to be looked up |
So is it an issue related to compilation of aws sdk libraries or is something missing in my cpp code? |
Can you try removing Update: But extern "C" should only affect those code inside { } and if it is the problem, function name of constructor should also be affected. And you would also have problem to find the symbol of constructor. |
There is no extern C in my native-lib.cpp code. Actually I have not compiled the aws sdk in Android studio. I have separately cross compiled the sdk in an Ubuntu platform and am trying to use those prebuilt libraries in my android project. So my code changes will not have any impact on the sdk libraries |
But I saw one from the code you attached above. |
Sorry. |
Hi, I can see you build out a dynamic library called libnative-lib.so, could you have look at the aws sdk related symbols' name in this library? |
Are you able to figure it out? |
README update for xcode build
README update for xcode build
Hello All,
I have cross-compiled the aws cpp for Android build and generated the shared libraries.
I would like to include these shared libraries in my Android application. My Android application will use Aws Transfer to download the files from S3 bucket.
When I run the above code in my application, I get undefined reference to UploadFile API. This code has been taken from TransferTests.cpp.
error: undefined reference to 'Aws::Transfer::TransferManager::UploadFile(Aws::String const&, Aws::String const&, Aws::String const&, Aws::String const&, std::map<Aws::String, Aws::String, std::lessAws::String, Aws::Allocator<std::pair<Aws::String const, Aws::String> > > const&)'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
There is no undefined reference for the constructor or for the transferManager.
This issue is only happening with the TransferManager code.
If I use S3 to download from bucket it is working fine.
Can anyone suggest how to resolve this issue ?
The text was updated successfully, but these errors were encountered: