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
0
votes
0 answers

Libconfig++ for windows

I have a project which was created under linux, it uses libconfig++. I need to port this project to windows, but I couldn’t find a way to install libconfig++ on windows. Is there any way to do it? Thanks in advance. P.s. i’m not into c++ that much…
0
votes
0 answers

How to look for a variable string in libconfig?

I'm using libconfig. I've a .cfg file. In this file, I have one only category: Services. Inside this category, I have many objects. Each object name has this format: objectname + underscore + 4numbers For example: alfa_1111 So, let's…
LearningC
  • 88
  • 1
  • 8
0
votes
1 answer

libconfig used in Qt readFile failed

firstly,I have downloaded the libconfig x64-windows via vcpkg like this: PS E:\vcpkg> .\vcpkg install libconfig:x64-windows then,I added the lib to my Qt project with three steps 1.add the headfile #include "libconfig.h++" 2.specify the lib path…
wenjx
  • 11
  • 3
0
votes
0 answers

Can i copy the libconfig::Setting from one libconfig::Config to another libconfig::Config?

I have a config ("/home/work/father.config") looks like: father_config = { child_config = "/home/work/child.config"; father_int = 1; }; in /home/work/child.config: child_config = { child_int =2; }; what i want is to get father_int from…
nick
  • 832
  • 3
  • 12
0
votes
0 answers

How to include .cfg file path for libconfig?

I'm using libconfig. The file .cfg is in the same directory of the .c file. I want to read the .cfg from a specific path. For example i want that the file could be in the previous directory (not in the same directory of the .c file). How can I do…
user14677223
0
votes
0 answers

How to solve this pointer error? (from incompatible pointer type)

I've this function:(myvariable is un unsigned int) config_setting_lookup_int64 is the libconfig.h function -> int config_lookup_int64 (const config t * config, [Function] const char * path, long long * value) config_setting_lookup_int64(file,…
user14677223
0
votes
1 answer

how to use libconfig to read several config files in one object?

Assume I have a libconfig::config object, can i readFile for several times like this: libconfig::Config cfg; cfg.readFiles("./a.cfg"); cfg.readFiles("./b.cfg"); and what will happen if a.cfg and b.cfg have same key? If this doesnt work, is there…
nick
  • 832
  • 3
  • 12
0
votes
1 answer

Segmentation fault when parsing group elemnt with libconfig

I'm trying to write C code to parse a config file using libconfig The config file contains a simple element and a group. A group is composed of multiple settings, each has a unique name. ref Config file : host_name = "HOST"; device_settings: { …
wael dr
  • 3
  • 2
0
votes
0 answers

None of the required 'libconfig++' found

I have built libconfig dependency in RHEL8 container but cmake is unable to detect it. CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:640 (message): None of the required 'libconfig++' found I can locate the object files at STEP 11: RUN…
0
votes
0 answers

Why would a call to libconfig's config_lookup function end the program?

I am using the very nice libconfig library, made by Mark Lindner. It is available as part of a Red Hat installation. Sometimes, when I called config_lookup the call doesn't return. Most times it does. Instead, the process stops running, and our…
user2171796
  • 397
  • 2
  • 16
0
votes
1 answer

Unable to find/read config file .conf - FileIOException

I'm trying to open and read a .conf file in my program using libconfig::readFile(), but it gives me always a FileIOException. I think that the program is unable to locate the file but I don't know where the problem is. This is the .conf file…
0
votes
1 answer

Returning libconfig class Setting object reference from function

I'm trying to use libconfig library to parse variables from an external configuration file. On libconfig site it says: The class Config represents a configuration, and the class Setting represents a configuration setting. Note that by design,…
nasw_264
  • 97
  • 1
  • 7
0
votes
0 answers

c++ cmake linking libconfig++

I did install package libconfig with Microsoft/vcpkg manager on Windows. And in Visual Studio trying to link libconfig++ to my project but it can't be linked. CMakeLists.txt cmake_minimum_required(VERSION 3.10) set(CMAKE_CXX_STANDARD…
Pahan
  • 11
  • 1
  • 6
0
votes
1 answer

How can I update config file with libconfig?

How can I update config file with libconfig ? I want to update without removing other content of file https://pypi.python.org/pypi/libconf for example RTL_test: { My_model : { tests = ["test1","test2","test3","test4"]; ignore =…
user9343376
0
votes
1 answer

SIGSEGV when reading config with libconfig

I can't retrieve the user value from my config file using C and libconfig. configreader.h #include #include #include #ifndef CONFIGREADER_H_INCLUDED #define CONFIGREADER_H_INCLUDED char *userreader(){ static…
Luís Duarte
  • 39
  • 1
  • 7