Problem integrating QT 5.10 C++ Desktop GUI project using AWS C++ SDK.
-
Greetings all,
I'm brand new to QT. I've consumed the AWS SDK in other languages but not C++ as it's not my primary language of use today. I'm entering both via QT due to a desire for developing cross platform desktop applications in support of Mac and Windows platform primarily.
My primary development environment is MacOS. (10.13 High Sierra)
We leverage AWS SQS quite extensively in our projects and are starting to also us Lambda and Kinesis. I've had some difficulty even getting a build of the SDK to work itself. Keeps giving me a "Undefined symbols for architecture x86_64". (Not QT specific in this case as I'm just building from the command line following the AWS docs.(
I discovered home brew had listed so instead of building from source at the moment, I used brew install aws-sdk-cpp to get an SDK build directory. I added this as an external library in QT Creator.
When I try to build I get symbol(s) not found for architecture x86_64
My project file is as follows:
#------------------------------------------------- # # Project created by QtCreator 2018-05-13T00:41:50 # #------------------------------------------------- QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = amazon TEMPLATE = app # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp \ mainwindow.cpp HEADERS += \ mainwindow.h FORMS += \ mainwindow.ui macx: LIBS += -L$$PWD/../../Desktop/aws-sdk-cpp/1.4.40/lib/ -laws-cpp-sdk-sqs INCLUDEPATH += $$PWD/../../Desktop/aws-sdk-cpp/1.4.40/include DEPENDPATH += $$PWD/../../Desktop/aws-sdk-cpp/1.4.40/include
I'm just using a simple function to attempt to send an SQS Message using the AWS example.
Does anyone have perhaps a simplistic starter project to consume any of the AWS SDK services such as SQS, SNS or S3 that they could point me to?
Excited to get going with this!
-
Well, I seem to have solved it. The error I was getting wasn't particularly helpful. In reality, I needed to also include the aws-sdk-core library in addition to the aws-sdk-sqs. It is now happily building and sending messages to SQS. I did still use the brew version of the aws-sdk-cpp. I'll have to work on getting the cmake to build the sdk-build directory the way QT wants. Yet another new thing to wrap my head around. But this gives me something to wire up with other projects via messaging so I'm excited to keep going now.
-
@Jim-Hankins Hi JIm, Did you get any error linking aws-cpp-sdk core statically with libcurl? I keep getting the error below when liniking statically to libcurl which is required by the aws-cpp-sdk:
libcurl.a(ldap.c.o):-1: error: Undefined symbols for architecture x86_64:
"_CFArrayAppendValue", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
_append_cert_to_array in libcurl.a(sectransp.c.o)
"_CFArrayCreate", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_CFArrayCreateMutable", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
_verify_cert in libcurl.a(sectransp.c.o)
"_CFArrayGetCount", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_CFArrayGetValueAtIndex", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_CFDataCreate", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
_append_cert_to_array in libcurl.a(sectransp.c.o)
"_CFDataGetBytePtr", referenced from:
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_CFDataGetLength", referenced from:
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_CFDictionaryCreate", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_CFDictionaryGetTypeID", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_CFDictionaryGetValue", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_CFGetTypeID", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_CFRelease", referenced from:
_Curl_sectransp_shutdown in libcurl.a(sectransp.c.o)
_Curl_sectransp_close in libcurl.a(sectransp.c.o)
_sectransp_connect_common in libcurl.a(sectransp.c.o)
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
_CopyCertSubject in libcurl.a(sectransp.c.o)
_verify_cert in libcurl.a(sectransp.c.o)
_append_cert_to_array in libcurl.a(sectransp.c.o)
...
"_CFRetain", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_CFStringCompare", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_CFStringCreateWithCString", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_CFStringGetCString", referenced from:
_CopyCertSubject in libcurl.a(sectransp.c.o)
"_CFStringGetCStringPtr", referenced from:
_CopyCertSubject in libcurl.a(sectransp.c.o)
"_CFStringGetLength", referenced from:
_CopyCertSubject in libcurl.a(sectransp.c.o)
"_CFURLCreateDataAndPropertiesFromResource", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_CFURLCreateFromFileSystemRepresentation", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLClose", referenced from:
_Curl_sectransp_shutdown in libcurl.a(sectransp.c.o)
_Curl_sectransp_close in libcurl.a(sectransp.c.o)
"_SSLCopyALPNProtocols", referenced from:
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_SSLCopyPeerTrust", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
_verify_cert in libcurl.a(sectransp.c.o)
"_SSLCreateContext", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLGetBufferedReadSize", referenced from:
_Curl_sectransp_data_pending in libcurl.a(sectransp.c.o)
"_SSLGetNegotiatedCipher", referenced from:
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_SSLGetNegotiatedProtocolVersion", referenced from:
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_SSLGetNumberSupportedCiphers", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLGetSessionState", referenced from:
_Curl_sectransp_check_cxn in libcurl.a(sectransp.c.o)
"_SSLGetSupportedCiphers", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLHandshake", referenced from:
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_SSLRead", referenced from:
_sectransp_recv in libcurl.a(sectransp.c.o)
"_SSLSetALPNProtocols", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLSetCertificate", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLSetConnection", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLSetEnabledCiphers", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLSetIOFuncs", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLSetPeerDomainName", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLSetPeerID", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLSetProtocolVersionMax", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLSetProtocolVersionMin", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLSetSessionOption", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SSLWrite", referenced from:
_sectransp_send in libcurl.a(sectransp.c.o)
"_SecCertificateCopyCommonName", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SecCertificateCopyLongDescription", referenced from:
_CopyCertSubject in libcurl.a(sectransp.c.o)
"_SecCertificateCreateWithData", referenced from:
_append_cert_to_array in libcurl.a(sectransp.c.o)
"_SecCertificateGetTypeID", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SecIdentityCopyCertificate", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SecIdentityCreateWithCertificate", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SecItemCopyMatching", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SecItemImport", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SecKeyCopyExternalRepresentation", referenced from:
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_SecPolicyCreateSSL", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SecTrustCopyPublicKey", referenced from:
_sectransp_connect_step2 in libcurl.a(sectransp.c.o)
"_SecTrustEvaluate", referenced from:
_verify_cert in libcurl.a(sectransp.c.o)
"_SecTrustGetCertificateAtIndex", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SecTrustGetCertificateCount", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_SecTrustSetAnchorCertificates", referenced from:
_verify_cert in libcurl.a(sectransp.c.o)
"_SecTrustSetAnchorCertificatesOnly", referenced from:
_verify_cert in libcurl.a(sectransp.c.o)
"Aws::S3::S3Client::S3Client(Aws::Client::ClientConfiguration const&, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy, bool, Aws::S3::US_EAST_1_REGIONAL_ENDPOINT_OPTION)", referenced from:
_main in main.o
"Aws::S3::S3Client::~S3Client()", referenced from:
_main in main.o
"Aws::S3::S3Client::ListBuckets() const", referenced from:
_main in main.o
"___CFConstantStringClassReference", referenced from:
CFString in libcurl.a(sectransp.c.o)
"_ber_free", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_kCFAllocatorDefault", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
_verify_cert in libcurl.a(sectransp.c.o)
_append_cert_to_array in libcurl.a(sectransp.c.o)
"_kCFBooleanTrue", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_kCFCopyStringDictionaryKeyCallBacks", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_kCFTypeArrayCallBacks", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
_verify_cert in libcurl.a(sectransp.c.o)
"_kCFTypeDictionaryValueCallBacks", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_kSecAttrLabel", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_kSecClass", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_kSecClassIdentity", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_kSecImportItemIdentity", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_kSecMatchLimit", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_kSecMatchLimitAll", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_kSecMatchPolicy", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_kSecReturnRef", referenced from:
_sectransp_connect_common in libcurl.a(sectransp.c.o)
"_ldap_err2string", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_first_attribute", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_first_entry", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_free_urldesc", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_get_dn", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_get_values_len", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_init", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_memfree", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_msgfree", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_next_attribute", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_next_entry", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_search_s", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_set_option", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_simple_bind_s", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_unbind_s", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_url_parse", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o)
"_ldap_value_free_len", referenced from:
_Curl_ldap in libcurl.a(ldap.c.o) -
@Ranto-Tiaray-Andrianavonison Hi,
You need to link to the appropriate macOS frameworks and libraries as well.