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

EC2 Linker Error #189

Closed
ChRis6 opened this issue May 27, 2016 · 17 comments
Closed

EC2 Linker Error #189

ChRis6 opened this issue May 27, 2016 · 17 comments
Labels
help wanted We are asking the community to submit a PR to resolve this issue.

Comments

@ChRis6
Copy link

ChRis6 commented May 27, 2016

Hello,

When I create an instance of the classes Aws::EC2::Model::CreateSecurityGroupRequest or
Aws::EC2::Model::AuthorizeSecurityGroupIngressRequest, I am getting a linker error :

error LNK2001: unresolved external symbol "char const * const Aws::Http::CONTENT_TYPE_HEADER" (?CONTENT_TYPE_HEADER@Http@Aws@@3PBDB)

I'm using visual studio 2013 on windows 7 and AWS Version 0.12.3.
I have noticed that the string is declared in aws-sdk-core and I have included aws-sdk-core.lib in my project (it is a depedency anyway),but still I'm getting the above linker error.

@bretambrose
Copy link
Contributor

We have encountered this problem sporadically in the past. Are you linking statically? Can you find that symbol (or any of the other extern strings its declared next to) if you dumpbin /symbols on aws-cpp-sdk-core.lib?

@Alien2150
Copy link

Alien2150 commented Jul 14, 2016

Having the same issue with Visual Studio 2015. But only if I use the x64 - version.

@JonathanHenson
Copy link
Contributor

This issue is usually caused by a missing dll import call. We just improved this on our latest push to make it easier to do this right.

For now, can you wipe out everything you've done in your project properties related to the SDK and try using Nuget package AWSSDKCPP-EC2?

It will make sure your project is setup properly for each target.

Sent from my iPhone

On Jul 14, 2016, at 9:06 AM, Thomas [email protected] wrote:

Having the same issue with Visual Studio 2015. But only if use the x64 - version.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@Alien2150
Copy link

Alien2150 commented Jul 14, 2016

I have AWSSDKCPP-Core + Redist and AWSSDKCPP-SQS & Redist. Not sure if that causes some conflicts?
/Update: Tried removing the Core Package but it is a dependency for SQS it seems

@JonathanHenson
Copy link
Contributor

Is your issue with EC2 or SQS? Do you need the EC2 binary? Anyways there should be no conflicts.

Sent from my iPhone

On Jul 14, 2016, at 9:24 AM, Thomas [email protected] wrote:

I have AWSSDKCPP-Core + redist and AWSSDKCPP-SQS & Redist. Not sure if that causes some conflicts?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@Alien2150
Copy link

Alien2150 commented Jul 14, 2016

For me at least I am using the SQS - SDK but the error-message is the same that was mentioned in the first post "error LNK2001: unresolved external symbol "char const * const Aws::Http::CONTENT_TYPE_HEADER" (?CONTENT_TYPE_HEADER@Http@Aws@@3PBDB)"

@JonathanHenson
Copy link
Contributor

And the error happens when you use the NuGet package?

Sent from my iPhone

On Jul 14, 2016, at 9:28 AM, Thomas [email protected] wrote:

For me at least I am using the SQS - SDK but the error-message is the same that was mentioned in the first post


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@Alien2150
Copy link

Alien2150 commented Jul 15, 2016

That is excatly what I used. I can send you a Visual Studio Solution Example project if that helps

@JonathanHenson
Copy link
Contributor

What version? Can you try updating to latest?

Sent from my iPhone

On Jul 14, 2016, at 10:26 PM, Thomas [email protected] wrote:

That is excatly what I used. I can send you a Visual Studio Solution if that helps


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@Alien2150
Copy link

Alien2150 commented Jul 18, 2016

Will try. I was working with 0.13.4

@Alien2150
Copy link

Still getting the same issue with 0.13.5 (Tried clean & rebuild) -> x64 / Release

@jliang1010
Copy link

AWSSDKCPP-transfer is not available through NuGet. Is there any plan to release through it in the near future?

@JonathanHenson
Copy link
Contributor

There is, I keep messing up the export. I'll try and get this updated as soon as possible.

@tttthiagoooo
Copy link

Hello, I was exactly with the same problem while trying to compile the example code;
Https://aws.amazon.com/blogs/developer/using-cmake-exports-with-the-aws-sdk-for-c/

Before, I had generated the project by CMake using the default settings.
To get compile with success, I changed the BUILD_SHARED_LIBS flag to false;

I'm using Visual Studio Community 2015/up3 on Windows 10 and https://github.com/aws/aws-sdk-cpp downloaded yesterday.

Since I did not use NuGet, I changed the following properties in the project in Visual Studio (Some settings I compared with the S3 SDK project);

[VC++ Directories]
Include Directories
C:\Dev\AWS\aws-sdk-cpp-master\aws-cpp-sdk-core\include;
C:\Dev\AWS\aws-sdk-cpp-master\aws-cpp-sdk-s3\include;
C:\Dev\AWS\aws-sdk-cpp-master\aws-cpp-sdk-s3-encryption\include;

Library Directories
C:\Dev\AWS\aws-sdk-cpp-bin\aws-cpp-sdk-core\Debug;
C:\Dev\AWS\aws-sdk-cpp-bin\aws-cpp-sdk-s3\Debug;
C:\Dev\AWS\aws-sdk-cpp-bin\aws-cpp-sdk-s3-encryption\Debug;

[C/C++ >> General]
Additional Include Directories
C:\Dev\AWS\aws-sdk-cpp-master\aws-cpp-sdk-core\include;
C:\Dev\AWS\aws-sdk-cpp-master\aws-cpp-sdk-s3\include;
C:\Dev\AWS\aws-sdk-cpp-master\aws-cpp-sdk-s3-encryption\include;

[Linker >> General]
Additional Library Directories
C:\Dev\AWS\aws-sdk-cpp-bin\aws-cpp-sdk-core\Debug;
C:\Dev\AWS\aws-sdk-cpp-bin\aws-cpp-sdk-s3\Debug;
C:\Dev\AWS\aws-sdk-cpp-bin\aws-cpp-sdk-s3-encryption\Debug;

[Linker >> Input]
Additional Dependencies
aws-cpp-sdk-core.lib;
aws-cpp-sdk-s3.lib;
aws-cpp-sdk-s3-encryption.lib;

[C/C++ >> Preprocessor]
Preprocessor Definitions
WIN32;_WINDOWS;_DEBUG;_CONSOLE;PLATFORM_WINDOWS;ENABLE_BCRYPT_ENCRYPTION;ENABLE_WINDOWS_CLIENT;AWS_S3_EXPORTS;USE_WINDOWS_DLL_SEMANTICS;CMAKE_INTDIR="Debug";aws_cpp_sdk_s3_EXPORTS;%(PreprocessorDefinitions)

@thearttrooper
Copy link

thearttrooper commented Jun 25, 2017

I am coming to this late but cloning the git repository and building locally then using the LIB/DLL combo in a simple console test program I had the same 'unresolved external' linker error. I resolved it by adding these pre-processor defines to my console test program's project:

USE_WINDOWS_DLL_SEMANTICS
USE_IMPORT_EXPORT

These affect what AWS_CORE_API becomes in the header files. See aws/core/Core_Exports.h.

@MaasErwin
Copy link

Can this issue be fixed in the SDK?

@singku
Copy link
Contributor

singku commented Jul 15, 2018

This should have been fixed, please follow the instructions in this issue. Reopen if you still have problem.

@singku singku closed this as completed Jul 15, 2018
@justnance justnance added help wanted We are asking the community to submit a PR to resolve this issue. and removed help wanted labels Apr 19, 2019
cobookman pushed a commit to cobookman/aws-sdk-cpp that referenced this issue Jan 17, 2022
(1) Missing initializer issues for gcc 4.9.4.
(2) StdIOStreamInputStream::ReadImpl() should return true when attempting to read bytes from empty stream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We are asking the community to submit a PR to resolve this issue.
Projects
None yet
Development

No branches or pull requests

10 participants