Issue while setting up Bluez on Ubuntu NUC: tools/mesh-cfgtest.c:132:10:10: error: Initializer element is not constant - python-3.x

I am trying to setup BLE-Mesh Provisioner on my Ubuntu NUC. Since kernel is already build in NUC Ubuntu with version 4.15.0-76 generic. Now I am trying to compile Bluez from source. I have performed following steps on my system:
Compiling dependency needed for bluez
Installing Json-library and Embedded Linux Library
Compiling Bluez
While compiling I am getting an error as:
tools/mesh-cfgtest.c:132:10: error: initializer element is not constant
.path = cli_app_path,
^
tools/mesh-cfgtest.c:132:10: note: (near initialization for ‘client_app.path’)
tools/mesh-cfgtest.c:133:16: error: initializer element is not constant
.agent_path = cli_agent_path,
^
tools/mesh-cfgtest.c:133:16: note: (near initialization for
‘client_app.agent_path’)
tools/mesh-cfgtest.c:141:12: error: initializer element is not constant
.path = cli_ele_path_00,
^
tools/mesh-cfgtest.c:141:12: note: (near initialization for
‘client_app.ele[0].path’)
tools/mesh-cfgtest.c:150:10: error: initializer element is not constant
.path = srv_app_path,
^
tools/mesh-cfgtest.c:150:10: note: (near initialization for ‘server_app.path’)
tools/mesh-cfgtest.c:151:16: error: initializer element is not constant
.agent_path = srv_agent_path,
^
tools/mesh-cfgtest.c:151:16: note: (near initialization for
‘server_app.agent_path’)
tools/mesh-cfgtest.c:159:12: error: initializer element is not constant
.path = srv_ele_path_00,
^
tools/mesh-cfgtest.c:159:12: note: (near initialization for
‘server_app.ele[0].path’)
tools/mesh-cfgtest.c:165:12: error: initializer element is not constant
.path = srv_ele_path_01,
^
tools/mesh-cfgtest.c:165:12: note: (near initialization for
‘server_app.ele[1].path’)
tools/mesh-cfgtest.c:214:9: error: initializer element is not constant
.idx = import_netkey_idx,
^
tools/mesh-cfgtest.c:214:9: note: (near initialization for
‘init_add_netkey_req.idx’)
tools/mesh-cfgtest.c:219:14: error: initializer element is not constant
.ele_path = cli_ele_path_00,
^
tools/mesh-cfgtest.c:219:14: note: (near initialization for
‘init_add_netkey_data.ele_path’)
tools/mesh-cfgtest.c:242:14: error: initializer element is not constant
.ele_path = cli_ele_path_00,
^
tools/mesh-cfgtest.c:242:14: note: (near initialization for
‘init_add_appkey_data.ele_path’)
tools/mesh-cfgtest.c:243:9: error: initializer element is not constant
.dst = import_node_unicast,
^
tools/mesh-cfgtest.c:243:9: note: (near initialization for
‘init_add_appkey_data.dst’)
tools/mesh-cfgtest.c:244:12: error: initializer element is not constant
.subnet = import_netkey_idx,
^
tools/mesh-cfgtest.c:244:12: note: (near initialization for
‘init_add_appkey_data.subnet’)
tools/mesh-cfgtest.c:271:14: error: initializer element is not constant
.ele_path = cli_ele_path_00,
^
tools/mesh-cfgtest.c:271:14: note: (near initialization for
‘test_add_appkey.ele_path’)
tools/mesh-cfgtest.c:272:9: error: initializer element is not constant
.dst = import_node_unicast,
^
tools/mesh-cfgtest.c:272:9: note: (near initialization for
‘test_add_appkey.dst’)
tools/mesh-cfgtest.c:273:12: error: initializer element is not constant
.subnet = import_netkey_idx,
^
tools/mesh-cfgtest.c:273:12: note: (near initialization for
‘test_add_appkey.subnet’)
tools/mesh-cfgtest.c:278:14: error: initializer element is not constant
.ele_path = cli_ele_path_00,
^
tools/mesh-cfgtest.c:278:14: note: (near initialization for
‘common_route.ele_path’)
tools/mesh-cfgtest.c:279:9: error: initializer element is not constant
.dst = import_node_unicast,
^
tools/mesh-cfgtest.c:279:9: note: (near initialization for ‘common_route.dst’)
tools/mesh-cfgtest.c:280:12: error: initializer element is not constant
. subnet = import_netkey_idx,
^
tools/mesh-cfgtest.c:280:12: note: (near initialization for
‘common_route.subnet’)
Makefile:7521: recipe for target 'tools/mesh-cfgtest.o' failed
make[1]: *** [tools/mesh-cfgtest.o] Error 1
Makefile:4468: recipe for target 'all' failed
make: *** [all] Error 2
I am attaching the screenshot for your reference:
Error Message:
I am following this reference to setup Bluez in system:
https://budimir.cc/2022/01/08/compile-bluez-from-source/
Please help me to resolve this problem while setting up bluez on Ubuntu.
I am expecting the exact solution or guide. How to set up Bluetooth-Low-Energy on Ubuntu. Basically when I was trying with Raspberrypi I was not able to install pygattlib and pybluez .. So I switched to Ubuntu and now I am expecting that there would be solution to resolve this issue. Please help me to resolve this issue

Related

How to implement a TBB input_node?

Apparently in tbb::flow the source_node has been deprecated, and starting in the 2021.1 version we are only supposed to use input_node. Simply replacing the class does not seem to work, though. I have a working code using source_node in version 2020.3. If I try using input_node I get a cryptic message.
It seems input_node expects Body to implement a function that takes a flow_control object. Is this the case? Otherwise what is wrong here?
I cannot seem to be able to run any example codes with input_body.
====================[ Build | capybara | Debug-System ]==========================
/home/nicolau/bin/clion-2020.1.1/bin/cmake/linux/bin/cmake --build /home/nicolau/src/capybara/cmake-build-debug-system --target capybara -- -j 9
Scanning dependencies of target capybara
[ 50%] Building CXX object CMakeFiles/capybara.dir/main.cpp.o
In file included from /home/nicolau/src/oneapi-tbb-2021.1-beta08/include/tbb/flow_graph.h:345:0,
from /home/nicolau/src/capybara/main.cpp:9:
/home/nicolau/src/oneapi-tbb-2021.1-beta08/include/tbb/detail/_flow_graph_body_impl.h: In instantiation of ‘Output tbb::detail::d1::input_body_leaf<Output, Body>::operator()(tbb::detail::d1::flow_control&) [with Output = std::tuple<cv::Mat, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > > >; Body = main(int, char**)::<lambda(imgtv&)>]’:
/home/nicolau/src/capybara/main.cpp:424:1: required from here
/home/nicolau/src/oneapi-tbb-2021.1-beta08/include/tbb/detail/_flow_graph_body_impl.h:88:66: error: no match for call to ‘(main(int, char**)::<lambda(imgtv&)>) (tbb::detail::d1::flow_control&)’
Output operator()(flow_control& fc) override { return body(fc); }
^
/home/nicolau/src/capybara/main.cpp:350:58: note: candidate: main(int, char**)::<lambda(imgtv&)>
tbb::flow::input_node<imgtv> src(g, [&](imgtv &v) -> bool {
^~~~
/home/nicolau/src/capybara/main.cpp:350:58: note: no known conversion for argument 1 from ‘tbb::detail::d1::flow_control’ to ‘imgtv& {aka std::tuple<cv::Mat, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > > >&}’
CMakeFiles/capybara.dir/build.make:82: recipe for target 'CMakeFiles/capybara.dir/main.cpp.o' failed
make[3]: *** [CMakeFiles/capybara.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/capybara.dir/all' failed
make[2]: *** [CMakeFiles/capybara.dir/all] Error 2
CMakeFiles/Makefile2:102: recipe for target 'CMakeFiles/capybara.dir/rule' failed
make[1]: *** [CMakeFiles/capybara.dir/rule] Error 2
Makefile:138: recipe for target 'capybara' failed
make: *** [capybara] Error 2
Apparently the interface has changed compared to source_node, and the function is now supposed to take a flow_control reference and return the new input object as output.
https://github.com/oneapi-src/oneTBB/issues/270#issuecomment-683645172

How do I fix this libgcrypt cross-compilation error?

I'm trying to cross compile GPG for an ElinOS on a board with an imx6. I have a problem when I compile libgcrypt. First, here's what I do:
export PATH=/opt/elinos/cdk/arm/v7hf/glibc/bin:$PATH
./configure --host=arm-unknown-linux-gnueabihf --build=i686-pc-linux-gnu
make all
The configuration part shows no errors or warning, but the make displays this:
hwf-arm.c:31:3: error: #error Module build for wrong CPU.
# error Module build for wrong CPU.
^
hwf-arm.c: In function 'get_hwcap':
hwf-arm.c:126:26: error: 'AT_HWCAP' undeclared (first use in this function)
if (auxv.a_type == AT_HWCAP)
^
hwf-arm.c:126:26: note: each undeclared identifier is reported only once for each function it appears in
hwf-arm.c:132:26: error: 'AT_HWCAP2' undeclared (first use in this function)
if (auxv.a_type == AT_HWCAP2)
^
In file included from hwf-arm.c:27:0:
hwf-arm.c: In function 'detect_arm_at_hwcap':
hwf-arm.c:159:23: error: 'arm_features' undeclared (first use in this function)
for (i = 0; i < DIM(arm_features); i++)
^
g10lib.h:96:24: note: in definition of macro 'DIM'
#define DIM(v) (sizeof(v)/sizeof((v)[0]))
^
hwf-arm.c: In function 'detect_arm_proc_cpuinfo':
hwf-arm.c:250:23: error: 'arm_features' undeclared (first use in this function)
for (i = 0; i < DIM(arm_features); i++)
^
g10lib.h:96:24: note: in definition of macro 'DIM'
#define DIM(v) (sizeof(v)/sizeof((v)[0]))
The first error leads me to this part of the code :
#if !defined (__arm__) && !defined (__aarch64__)
# error Module build for wrong CPU.
#endif
Any idea where this comes from? It looks like a configuration problem, but I'm not sure where to look now.
In the config.log file, CC was setup correctly: CC='arm-unknown-linux-gnueabihf-gcc'.
Yet I needed to specify it in the make command. So instead of simply using make all, which didn't work, I had to use make all CC=arm-unknown-linux-gnueabihf-gcc.

Go Get OAuth2 Giving Me Weird Errors on Linux Mint

Attempting to follow along with https://jacobmartins.com/2016/02/29/getting-started-with-oauth2-in-go/
When I run go get golang.org/x/oauth2 nothing weird comes up, but when attempting to run the code using go run main.go
I get the following in my terminal:
# google.golang.org/grpc/credentials
../../../google.golang.org/grpc/credentials/credentials_util_pre_go17.go:58:32: error: reference to undefined field or method ‘GetCertificate’
GetCertificate: cfg.GetCertificate,
^
../../../google.golang.org/grpc/credentials/credentials_util_pre_go17.go:69:32: error: reference to undefined field or method ‘ClientSessionCache’
ClientSessionCache: cfg.ClientSessionCache,
^
../../../google.golang.org/grpc/credentials/credentials_util_pre_go17.go:72:32: error: reference to undefined field or method ‘CurvePreferences’
CurvePreferences: cfg.CurvePreferences,
^
../../../google.golang.org/grpc/credentials/credentials_util_pre_go17.go:58:3: error: unknown field ‘GetCertificate’ in ‘tls.Config’
GetCertificate: cfg.GetCertificate,
^
# golang.org/x/net/http2/hpack
../../../golang.org/x/net/http2/hpack/huffman.go:14:20: error: reference to undefined identifier ‘sync.Pool’
var bufPool = sync.Pool{
^
../../../golang.org/x/net/http2/hpack/huffman.go:14:24: error: expected ‘;’ or newline after top level declaration
var bufPool = sync.Pool{
^
# golang.org/x/net/context/ctxhttp
../../../golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go:36:5: error: reference to undefined field or method ‘Cancel’
req.Cancel = cancel
^
# golang.org/x/oauth2/jws
../../../golang.org/x/oauth2/jws/jws.go:75:17: error: reference to undefined identifier ‘base64.RawURLEncoding’
return base64.RawURLEncoding.EncodeToString(b), nil
^
../../../golang.org/x/oauth2/jws/jws.go:93:16: error: reference to undefined identifier ‘base64.RawURLEncoding’
return base64.RawURLEncoding.EncodeToString(b), nil
^
../../../golang.org/x/oauth2/jws/jws.go:113:16: error: reference to undefined identifier ‘base64.RawURLEncoding’
return base64.RawURLEncoding.EncodeToString(b), nil
^
../../../golang.org/x/oauth2/jws/jws.go:124:25: error: reference to undefined identifier ‘base64.RawURLEncoding’
decoded, err := base64.RawURLEncoding.DecodeString(s[1])
^
../../../golang.org/x/oauth2/jws/jws.go:151:41: error: reference to undefined identifier ‘base64.RawURLEncoding’
return fmt.Sprintf("%s.%s", ss, base64.RawURLEncoding.EncodeToString(sig)), nil
^
../../../golang.org/x/oauth2/jws/jws.go:174:33: error: reference to undefined identifier ‘base64.RawURLEncoding’
signatureString, err := base64.RawURLEncoding.DecodeString(parts[2])
Go version is go version xgcc (Ubuntu 4.9.3-0ubuntu4) 4.9.3 linux/amd64
Running Linux Mint 17.3 Cinnamon
Anyone know what I'm doing wrong?
Looks like you are using go cgo installation. On Linux mint golang-go seems to be the distribution name.
But I would suggest installing the latest version of go (or version go 1.5 atleast) as mentioned in the below link and try again.
https://golang.org/doc/install
Remove your current installation before proceeding with the golang-go installation.

" error: unknown field ‘compat_ioctl’ specified in initializer " while creating dummy ioctl

static const struct inode_operations msdos_dir_inode_operations = {
.create = msdos_create,
.lookup = msdos_lookup,
.unlink = msdos_unlink,
.mkdir = msdos_mkdir,
.rmdir = msdos_rmdir,
.rename = msdos_rename,
.setattr = fat_setattr,
.getattr = fat_getattr,
.compat_ioctl = my_ioctl, ---->error
};
i also tried with unlocked_ioctl but same error occured
[root#localhost fat]# make
make -C /lib/modules/3.11.10-100.fc18.x86_64/build M=/home/aditya/linux-3.12.6/fs/fat modules
make[1]: Entering directory `/usr/src/kernels/3.11.10-100.fc18.x86_64'
CC [M] /home/aditya/linux-3.12.6/fs/fat/namei_msdos.o
/home/aditya/linux-3.12.6/fs/fat/namei_msdos.c:646:2: error: unknown field ‘compat_ioctl’ specified in initializer
/home/aditya/linux-3.12.6/fs/fat/namei_msdos.c:646:2: warning: initialization from incompatible pointer type [enabled by default]
/home/aditya/linux-3.12.6/fs/fat/namei_msdos.c:646:2: warning: (near initialization for ‘msdos_dir_inode_operations.setxattr’) [enabled by default]
make[2]: * [/home/aditya/linux-3.12.6/fs/fat/namei_msdos.o] Error 1
make[1]: * [module/home/aditya/linux-3.12.6/fs/fat] Error 2
make[1]: Leaving directory `/usr/src/kernels/3.11.10-100.fc18.x86_64'
make: * [all] Error 2
The ioctl has been changed for a reason and it would be best if you follow the kernel changes in your driver too. You can not use drivers compiled for one version in another.
The change is not too difficult one.
In the fops structure change
ioctl to unlocked_ioctl
and in the ioctl function in your driver, do not pass the inode pointer. That is all, the rest of the code can remain the same.
see this tutorial for more details

Error Getting libframe to compile

I am trying to compile libframe. When I do, I receive the following messages.
BaseException.cpp: In constructor 'BaseException::BaseException()':
BaseException.cpp:30:33: error: 'strcpy' was not declared in this scope
BaseException.cpp: In constructor 'BaseException::BaseException(const char*)':
BaseException.cpp:35:31: error: 'strncpy' was not declared in this scope
BaseException.cpp: In constructor 'BaseException::BaseException(std::string&)':
BaseException.cpp:41:39: error: 'strncpy' was not declared in this scope
BaseException.cpp: In static member function 'static BaseException BaseException::factory(const char*, ...)':
BaseException.cpp:49:31: error: 'memset' was not declared in this scope
make[1]: *** [BaseException.o] Error 1
make[1]: Leaving directory `/home/alanc/media_man/libframe/libframe-1.0.0/src'
make: *** [all-recursive] Error 1
I am having trouble finding any information about this program.
libframe
Thanks.

Resources