Questions tagged [libconfig]

Libconfig is a simple library for processing structured configuration files. This file format is more compact and more readable than XML. And unlike XML, it is type-aware, so it is not necessary to do string parsing in application code. The library includes bindings for both the C and C++ languages. It works on POSIX-compliant UNIX and UNIX-like systems (GNU/Linux, Mac OS X, Solaris, FreeBSD), Android, and Windows (2000, XP and later).

Libconfig is a simple library for processing structured configuration files. This file format is more compact and more readable than XML. And unlike XML, it is type-aware, so it is not necessary to do string parsing in application code.

Libconfig is very compact — a fraction of the size of the expat XML parser library. This makes it well-suited for memory-constrained systems like handheld devices.

The library includes bindings for both the C and C++ languages. It works on POSIX-compliant UNIX and UNIX-like systems (GNU/Linux, Mac OS X, Solaris, FreeBSD), Android, and Windows (2000, XP and later).

78 questions
2
votes
0 answers

Libconfig: Take a copy of a libconfig::Config object?

I'm using libconfig in C++. Removing the surrounding complexity, I have read in a configuration and changed some settings. Now I want to take a copy of that Config object and make independent changes to the original and the copy. How can I do that?…
Obiphil
  • 361
  • 1
  • 6
  • 17
2
votes
1 answer

Libconfig error when parse first two values

I using libconfig C api for parsing properties file. I got null value in first two properties. test.properties x = "hello"; y = "world"; z = "test" ; config.c char * getValueByKey(char * file_name , char * key) { config_t cfg; …
Muthu GM
  • 63
  • 8
2
votes
1 answer

libconfig++ : adding a setting to the root of the configuration tree

I have a configuration file myCfg.cfg that looks like this : keyA = 1.0 keyB = 2 keyC = "hello" Note that all the settings are at the root of the configuration tree. I want my C++ program to load that file then add a new setting whose key is keyD…
Gael Lorieul
  • 3,006
  • 4
  • 25
  • 50
2
votes
1 answer

How to link libconfig library for Raspberry Pi application

Currently, I am modifying the C application for Raspberry Pi. I build the application with this command: make Now I want to use libconfig library. I have this below problems pi@raspberrypi ~/yyyyy $ make make --no-print-directory all-am CC …
Nam Vu
  • 5,669
  • 7
  • 58
  • 90
2
votes
2 answers

Reading config file in C using libconfig

I defined a structure for options in my config file and a pointer to this structure in "config.h" file and I read config file using libconfig and set values in function get_config() that is defined in file "config.c". In main function I initialize…
MSH
  • 429
  • 3
  • 7
  • 20
2
votes
1 answer

Variable in struct corrupted when storing value using library function

I'm trying the write a service that pings the watchdog device using the linux watchdog driver. In the function named 'LoadConfigurationFile' I pass a pointer to a struct that is defined above. That function then gets a string and stores it at the…
clockley1
  • 464
  • 5
  • 16
2
votes
0 answers

Looking for libconfig java wrapper

currently I'm working on a java webapplication development and it require me to parse this libconfig file http://www.hyperrealm.com/libconfig/ . But I can't find any compatible library in Java to parse libconfig file. Any idea? And worst case have…
guaz
  • 191
  • 1
  • 1
  • 17
2
votes
1 answer

Warnings with pointer using .cfg file

I try to setup a c programm using the libconfig. There is example1.c: int main() { const char **channel; config_t config; config_init(&config); config_read_file(&config, "example.cfg"); if(…
Fendrix
  • 556
  • 2
  • 11
  • 34
1
vote
1 answer

using 3rd party library (libconfig) with Qt (C++)

I'm having trouble getting a third party library (libconfig++) to work in Qt. When compiling in Qt, I get error messages such as: undefined reference to `_imp___ZN9libconfig6ConfigC1Ev' undefined reference to…
Peter991
  • 125
  • 1
  • 1
  • 5
1
vote
0 answers

ERROR: swupdate-2021.04-r0 do_compile: oe_runmake failed | json-c/json.h: No such file or directory

I am trying to integrate SWUpdate framework with Hawkbit. I am facing some issue after changing configuration to include Suricatta in SWUpdate. Steps I have done: Enabled Suricatta in menuconfig. Ran make command. No issues here Bitbaked again the…
Preeti
  • 535
  • 1
  • 6
  • 30
1
vote
0 answers

C++ how to make a root of .cfg file

I have this .cfg file and my problem is that I am trying to read and extract info using the libconfig library in the .cfg file but I can't create a root up to the AboCombi element. I would like to know how to create a root of more than 2 elements of…
WeeZ_1997
  • 11
  • 2
1
vote
1 answer

Libconfig and unsigned long. How to operate with UL?

I've an issue: name = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // Store inventory: params = { myparams= ( { max_len = 1024UL; author = "Robert Louis Stevenson"; price = 29.99; qty = 5; } …
user14677223
1
vote
1 answer

Why is config_read_file() returning config_false?

I have been using libconfig for config files in a project. When I remove the double quotes from sources by source_to_use, config_read_file() returns config_true and also has a syntax error. The syntax error will cause my getter for the source_to_use…
Dotz0cat
  • 33
  • 5
1
vote
2 answers

C & libconfig: config_lookup_bool returns CONFIG_FALSE

I'm trying to read a bool setting from a group. I'm using the following code, but config_lookup_bool always returns CONFIG_FALSE. As far as I understood it should write the value into send_keys and return CONFIG_TRUE instead. Code: int…
pikim
  • 11
  • 1
1
vote
1 answer

Cross compilation using Renesas G1E toolchain. Getting linker error though library files are already there in lib directory

I am trying cross compile C code (outside yocto) using toolchain (/home/amruta/Downloads/poky-glibc-x86_64-core-image-weston-sdk-cortexa7hf-neon-toolchain-2.4.2.sh) for renesas G1E module. Procedure followed to cross compile : Installed given…
APS
  • 59
  • 1
  • 7