Closed nagarajec closed 4 years ago
@vareddy could you please clarify? thoughts?
Could you try?
int main(int argc, char **argv) {
awsiotsdk::samples::PubSub pubSub;
int a = pubSub.addFunction(4, 6);
printf("Result :%i\n",a);
}
Hi Nagaraj , I am working on the PubSub in samples. I havent created any separate main.cpp. I am trying the example in PubSub.cpp. I am trying to build it . But its giving me errors like OpenSSLConnection.hpp is not found inspite of adding the include files.This is my task.json file { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "taskName": "build", "command": "g++", "args": [ "-g", "PubSub.cpp", "libaws-iot-sdk-cpp.a"
],
"problemMatcher": [
"$gcc"
]
}
]
} Please let me know if i have to add any other static libs or so .Thanks in advance I have included the header files in c_cpp_properties.json.Its as below.I have build the SDK using CMAkE and created the static library .
{ "configurations": [ { "name": "Linux", "includePath": [ "/home/mahathi/Dev/aws-iot-device-sdk-cpp/include", "/home/mahathi/Dev/aws-iot-device-sdk-cpp/build/third_party/rapidjson/src/include/rapidjson", "/home/mahathi/Dev/aws-iot-device-sdk-cpp/include", "/home/mahathi/Dev/aws-iot-device-sdk-cpp/common", "/home/mahathi/Dev/aws-iot-device-sdk-cpp/build/third_party/rapidjson/src/include", "/home/mahathi/Dev/aws-iot-device-sdk-cpp/network/OpenSSL" ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "gcc-x64" } ], "version": 4
Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deserves. We encourage you to try V2 and if you find that this is still a problem, please feel free to open a new issue there.
Hi All, I have below questions:
./main_body_pub_test.cpp:16:11: error: ‘addFunction’ is not a member of ‘awsiotsdk::samples’ int a = awsiotsdk::samples::addFunction(4,6);
main_body_pubtest.cpp: #include
include
include "PubSub.hpp"
int main(int argc, char **argv) { int a = awsiotsdk::samples::addFunction(4,6); printf("Result :%i\n",a); }_
PubSub.hpp: #pragma once namespace awsiotsdk { namespace samples { class PubSub { public: int addFunction(int a, int b); }; } }
MakeFile: _CXX=g++ SYS_HEADER_DIR = /usr/local/include/ APP_DIR = ./ APP_NAME = main_body_pub_test APP_C_FILES = $(APP_DIR)$(APP_NAME).cpp APP_H_FILES = $(APP_DIR)PubSub.hpp $(SYS_HEADER_DIR)/curl/curl.h STATIC_LIBS_DIR = ./ STATIC_LIBS = ./libaws-iot-sdk-cpp.a -lcurl -lmbedtls -lmbedcrypto -lmbedx509 SOURCES = $(APP_C_FILES) $(APP_H_FILES) $(STATIC_LIBS) $(APP_NAME):$(SOURCES) $(CXX) -std=c++11 -o $@ $(APP_C_FILES) $(STATICLIBS)