Hi guys it’ Luca,
I’m trying to compile the sdk c++ library with no success.
My OS: “Debian GNU/Linux 11 (bullseye)”
The only misssing prerequisites was libcurl so I did:
apt install libcurl4-openssl-dev
I don’t need lua so I edited init.mk like so:
SR_PLUGIN_LUA:=0
CPPFLAGS:=$(shell pkg-config --cflags libcurl lua)
CXXFLAGS:=-Wall -pedantic -Wextra
LDLIBS:=$(shell pkg-config --libs libcurl lua)
Then follwoing the rest of the tutorial but I don’t know what to do about this:
- Starts developing your Cumulocity agent and link it to the library with -lsera.
What should I do? Should I do something on MakeFile?
Then, ignoring the previous point I tried to run:
make release
Results in error:
Package lua was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua' found
Package lua was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua' found
Package lua was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua' found
Package lua was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua' found
(CXX) build/smartrest.o
(CXX) build/sragent.o
(CXX) build/srbootstrap.o
(CXX) build/srdevicepush.o
src/srdevicepush.cc: In static member function ‘static void* SrDevicePush::func(void*)’:
src/srdevicepush.cc:102:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
102 | }
| ^
src/srdevicepush.cc:106:13: note: here
106 | case BAYEUX_STATE_SUBSCRIBE:
| ^~~~
src/srdevicepush.cc:130:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
130 | }
| ^
src/srdevicepush.cc:134:13: note: here
134 | case BAYEUX_STATE_CONNECT:
| ^~~~
(CXX) build/srlogger.o
(CXX) build/srnetbinhttp.o
(CXX) build/srnethttp.o
(CXX) build/srnetinterface.o
(CXX) build/srnetmqtt.o
(CXX) build/srnetsocket.o
(CXX) build/srreporter.o
(CXX) build/srtimer.o
(CXX) build/srutils.o
(CC) build/MQTTConnectClient.o
(CC) build/MQTTConnectServer.o
(CC) build/MQTTDeserializePublish.o
(CC) build/MQTTFormat.o
(CC) build/MQTTPacket.o
(CC) build/MQTTSerializePublish.o
(CC) build/MQTTSubscribeClient.o
(CC) build/MQTTSubscribeServer.o
(CC) build/MQTTUnsubscribeClient.o
(CC) build/MQTTUnsubscribeServer.o
(LD) lib/libsera.so.1.2.7
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrAgent::~SrAgent()':
<artificial>:(.text+0x870): undefined reference to `curl_global_cleanup'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetInterface::~SrNetInterface()':
<artificial>:(.text+0xc08): undefined reference to `curl_easy_cleanup'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetBinHttp::~SrNetBinHttp()':
<artificial>:(.text+0xc84): undefined reference to `curl_slist_free_all'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetHttp::~SrNetHttp()':
<artificial>:(.text+0xcf8): undefined reference to `curl_slist_free_all'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrAgent::SrAgent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, SrIntegrate*, SrBootstrap*)':
<artificial>:(.text+0x1b30): undefined reference to `curl_global_init'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetBinHttp::post(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
<artificial>:(.text+0x45a0): undefined reference to `curl_formadd'
/usr/bin/ld: <artificial>:(.text+0x45c4): undefined reference to `curl_formadd'
/usr/bin/ld: <artificial>:(.text+0x4614): undefined reference to `curl_formadd'
/usr/bin/ld: <artificial>:(.text+0x4628): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x463c): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x464c): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x465c): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x4664): undefined reference to `curl_easy_perform'
/usr/bin/ld: <artificial>:(.text+0x4670): undefined reference to `curl_formfree'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetBinHttp::postf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
<artificial>:(.text+0x4e60): undefined reference to `curl_formadd'
/usr/bin/ld: <artificial>:(.text+0x4e84): undefined reference to `curl_formadd'
/usr/bin/ld: <artificial>:(.text+0x4ec4): undefined reference to `curl_formadd'
/usr/bin/ld: <artificial>:(.text+0x4ed8): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x4eec): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x4efc): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x4f0c): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x4f14): undefined reference to `curl_easy_perform'
/usr/bin/ld: <artificial>:(.text+0x4f20): undefined reference to `curl_formfree'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetBinHttp::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
<artificial>:(.text+0x52a4): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x52b4): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x52e8): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5308): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5310): undefined reference to `curl_easy_perform'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetBinHttp::getf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
<artificial>:(.text+0x57a0): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x57b0): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x57c0): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x57fc): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5814): undefined reference to `curl_easy_perform'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetHttp::post(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
<artificial>:(.text+0x5ad0): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5ae0): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5ae8): undefined reference to `curl_easy_perform'
/usr/bin/ld: <artificial>:(.text+0x5b34): undefined reference to `curl_easy_getinfo'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetInterface::SrNetInterface(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
<artificial>:(.text+0x5c6c): undefined reference to `curl_easy_init'
/usr/bin/ld: <artificial>:(.text+0x5c7c): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5c8c): undefined reference to `curl_easy_setopt'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetBinHttp::SrNetBinHttp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
<artificial>:(.text+0x5d4c): undefined reference to `curl_slist_append'
/usr/bin/ld: <artificial>:(.text+0x5d58): undefined reference to `curl_slist_append'
/usr/bin/ld: <artificial>:(.text+0x5d6c): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5d7c): undefined reference to `curl_easy_setopt'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetHttp::SrNetHttp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
<artificial>:(.text+0x5e18): undefined reference to `curl_slist_append'
/usr/bin/ld: <artificial>:(.text+0x5e24): undefined reference to `curl_slist_append'
/usr/bin/ld: <artificial>:(.text+0x5e2c): undefined reference to `curl_slist_append'
/usr/bin/ld: <artificial>:(.text+0x5e50): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5e64): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5e74): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5e84): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x5e98): undefined reference to `curl_easy_setopt'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o:<artificial>:(.text+0x5ea8): more undefined references to `curl_easy_setopt' follow
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetHttp::SrNetHttp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
<artificial>:(.text+0x5ee8): undefined reference to `curl_slist_append'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetInterface::setTimeout(long)':
<artificial>:(.text+0x6694): undefined reference to `curl_easy_setopt'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetInterface::setDebug(long)':
<artificial>:(.text+0x7c4c): undefined reference to `curl_easy_setopt'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetSocket::SrNetSocket(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
<artificial>:(.text+0x7e84): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x7e94): undefined reference to `curl_easy_setopt'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetSocket::connect()':
<artificial>:(.text+0x7ff8): undefined reference to `curl_easy_setopt'
/usr/bin/ld: <artificial>:(.text+0x802c): undefined reference to `curl_easy_perform'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetSocket::sendBuf(char const*, unsigned long)':
<artificial>:(.text+0x81e0): undefined reference to `curl_easy_getinfo'
/usr/bin/ld: <artificial>:(.text+0x821c): undefined reference to `curl_easy_send'
/usr/bin/ld: /tmp/libsera.so.1.2.7.JQ8g6r.ltrans0.ltrans.o: in function `SrNetSocket::recv(unsigned long)':
<artificial>:(.text+0x83e0): undefined reference to `curl_easy_getinfo'
/usr/bin/ld: <artificial>:(.text+0x8418): undefined reference to `curl_easy_recv'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:78: lib/libsera.so.1.2.7] Error 1
make: *** [Makefile:67: release] Error 2
Best
Luca