Hi,
I would like to run the program on my device, Numaker-IoT-M487 , but I got a compilation error.
This program are expected to establish a MQTT connection to the AWS IoT core .
The “AWSClient.h” was included at the beginning of the program and this header file is inside “mbed-client-for-aws ” SDK.
I got the following error while compiling.
After that, I changed my “CMakeLists.txt” as the following.
target_include_directories(${APP_TARGET}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/mbed-client-for-aws/include/AWSClient
)
target_sources(${APP_TARGET}
PRIVATE
main.cpp
mbed-client-for-aws/source/AWSClient.cpp
)
target_link_libraries(${APP_TARGET}
mbed-os
mbed-netsocket
mbed-cellular
mbed-client-for-aws
)
It didn’t work and I still recieved the same error.
The example project of AWS MQTT from Nuvoton are not suit for my comming development, therefore I would like to run the Mbed official example my device.
Do anyone have related experience can share with me?
I will really appreciate for suggestions.
MACRUM
(Toyomasa Watarai)
May 17, 2022, 8:02am
2
Hi,
This is probably useful topic:
opened 01:33PM - 11 Jun 21 UTC
mirrored
Jira status: OPEN
IOTOSM-4067
Hi, this project i configured it for IoT-M487 kit from nuvoton in mbedapp.json b… ut is throwing error for tlssocket as shown below
**"Compile [ 1.9%]: AWSClient.cpp
[Error] AWSClient.h@52,5: unknown type name 'TLSSocket'; did you mean 'TCPSocket'?
[Error] AWSClient.cpp@271,28: undeclared identifier 'TLSSocket' in destructor name
[Error] AWSClient.cpp@272,34: unknown type name 'TLSSocket'; did you mean 'TCPSocket'?
[Error] AWSClient.cpp@275,27: no member named 'set_hostname' in 'TCPSocket'
[Error] AWSClient.cpp@278,27: no member named 'set_client_cert_key' in 'TCPSocket'
[Error] AWSClient.cpp@284,27: no member named 'set_ca_chain' in 'TCPSocket'
[ERROR] In file included from .\mbed-client-for-aws\source\AWSClient.cpp:26:
./mbed-client-for-aws/include/AWSClient\AWSClient.h:52:5: error: unknown type name 'TLSSocket'; did you mean 'TCPSocket'?
TLSSocket socket;
^~~~~~~~~
TCPSocket
./mbed-os/connectivity/netsocket/include\netsocket/TCPSocket.h:33:7: note: 'TCPSocket' declared here
class TCPSocket : public InternetSocket {
^
.\mbed-client-for-aws\source\AWSClient.cpp:271:28: error: undeclared identifier 'TLSSocket' in destructor name
networkContext.socket.~TLSSocket();
^~~~~~~~~
TCPSocket
.\mbed-client-for-aws\source\AWSClient.cpp:272:34: error: unknown type name 'TLSSocket'; did you mean 'TCPSocket'?
new (&networkContext.socket) TLSSocket();
^~~~~~~~~
TCPSocket
./mbed-os/connectivity/netsocket/include\netsocket/TCPSocket.h:33:7: note: 'TCPSocket' declared here
class TCPSocket : public InternetSocket {
^
.\mbed-client-for-aws\source\AWSClient.cpp:275:27: error: no member named 'set_hostname' in 'TCPSocket'
networkContext.socket.set_hostname(hostname);
~~~~~~~~~~~~~~~~~~~~~ ^
.\mbed-client-for-aws\source\AWSClient.cpp:278:27: error: no member named 'set_client_cert_key' in 'TCPSocket'
networkContext.socket.set_client_cert_key(creds.clientCrt,
~~~~~~~~~~~~~~~~~~~~~ ^
.\mbed-client-for-aws\source\AWSClient.cpp:284:27: error: no member named 'set_ca_chain' in 'TCPSocket'
networkContext.socket.set_ca_chain(&rootCA);
~~~~~~~~~~~~~~~~~~~~~ ^
6 errors generated."**
is this project support this target or how I can resolve this issue?
1 Like
Hi @MACRUM ,
Much appreciated for your sharing!
It is exactly what I need and the error was fixed.