Questions tagged [c++]
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.
319
questions
0
votes
0
answers
36
views
What's the best practis to change some line in the GCC?
due to a project i need to bring some changes to the GCC and compile with it, is there any best practice or suggest before re-build the whole GCC? also I'm the area of focus will be mainly a specific ...
0
votes
0
answers
44
views
Is it possible to use webassembly in QNX
I’m trying to figure out if I’m able to port a webassembly based webapplication to QNX. But it is hard to find any information about what versions of browsers and web engine libraries that are shipped ...
0
votes
0
answers
79
views
Read physical state of keyboard modifiers in Linux (preferably in C or C++)
Is there a way to programmatically read, detect or get notified about the actual physical state of a modifier key, without requiring root level access rights?
I tried X11, XCB and XKB, but their event ...
0
votes
0
answers
74
views
Tried accesing my custom shared object, but permission is denied
Created a basic C++ shared objects file using g++:
// calculate.hpp
#ifdef __cplusplus
extern "C"
{
#endif
// typedef struct ...;
// function decls
int Add(int x, int y);
#ifdef ...
0
votes
0
answers
27
views
Problem with connection between custom application and qpidd compiled on ArchLinux while running them on Debian
I have a custom application and qpidd (Qpid version 1.36) which had been built on ArchLinux. Default TCP with default settings is used as protocol to connect to the running qpidd, and the connection ...
0
votes
1
answer
66
views
How to install the Boost.CRC library on Debian
I need to install the Boost CRC library on Debian 11.7. I've searched in Synaptic Package Manager but did't find it.
Also, I would prefer to install just that specific library (in a minimal ...
0
votes
1
answer
1k
views
Import Error: /lib/libgdal.so.26: undefined symbol: TIFFReadRGBATileExt, version LIBTIFF_4.0
OS: Ubuntu 20.04 (Focal-Fossa)
I get this error while running running opensfm binaries. This is not related to opensfm as it has run correctly on previous ubuntu20.04 installation.
Error seems to ...
0
votes
0
answers
116
views
Why do I have to put -Wl,--dynamic-linker flag if it points to same location
Yes, I know about this question but this is not a duplicate.
I try to run my app in an older system where glibc 2.12 is installed. What I need is glibc 2.19 and I have installed it and I give its ...
1
vote
1
answer
112
views
Launching Steam Game requires acceptance of elevation dialogs from Steam to install prerequisites
I'm having issues with launching a game through Steam I've installed through flatpak. I'm using Ubuntu 22.04.2 LTS. Steam Flatpak Version 1.0.0.75.
I'm trying to run a game called SpaceEngineers, and ...
1
vote
1
answer
67
views
vulkan build error : 'createResultValue' is not a member of 'vk'
I'm trying to compile a program that uses vulkan hpp and it uses a method in a file named vulkan_driver.h like this:
// Evaluate f and if result is not a success throw proper vk exception.
#define ...
0
votes
0
answers
37
views
How to get crash information of an executable to another dependent executable?
I have two C++ compiled executables in Linux machine, both are dependent on each other. First task has to monitor the second task continuously and if second task either terminates or restarts, the ...
0
votes
0
answers
239
views
libhdf5.so.200, needed by /opt/opencv3/lib/libopencv_hdf.so, not found
I developing C++ application with Qt&OpenCV. Last week i was building my application without any error but now I got the error:
/usr/bin/ld: warning: libhdf5.so.200, needed by /opt/opencv3/lib/...
0
votes
1
answer
933
views
Trying to understand memory-mapping with C++ in Linux environment
I've been tasked at worked to explore memory mapping to see if we can utilize it.
I'm trying to wrap my head around the concept and how to write the code. I've been trying out the code in the ...
0
votes
0
answers
21
views
Where to find the source code of openjdk 1.4? [duplicate]
Recently I need to compile JDK source code on Linux. It requires JNI 1.4 and JAWT 1.4 so I need to get the source code of openjdk 1.4. But I find it hard to find the source code of this jdk version. ...
5
votes
1
answer
3k
views
How to build GCC 13 on M1 MacBook pro?
I want to build gcc-13 on my M1 MacBook Pro. Following official document, I download source code using git, configure and make.
For configure, I refer to the way of Homebrew configure gcc-12 on link. ...
0
votes
1
answer
356
views
What's the idiomatic way of obtaining the "default" C++ include base path?
I'm building a command-line for some utility which, for some reason, needs the C++ include root, e.g. /usr/include/c++/10 (for libstdc++ of GCC-10). My question is: How do I determine what that path ...
0
votes
1
answer
71
views
How to "merge" sln files?
Im pretty new to c++ and want to add keyauth to my simple application. I want to use this (https://github.com/KeyAuth/KeyAuth-CPP-Example) as a base. How do I add the solution file to my existing ...
0
votes
2
answers
903
views
Print ASCII extended table with C++ (won't print cyrillics - ukrainian letters)
So, I am to print ASCII extended table in C++, it must include Ukrainian letters (cyrilics).
I am on KDE neon 5.26 linux distribution, it is based on Ubuntu. Terminal is KDE's Console obiviously.
I ...
0
votes
1
answer
603
views
error trying to build/make from source
I'm trying to build opendingux from github repo/source. https://github.com/OpenDingux/buildroot
OpenDingux is an embedded Linux distribution focused on (retro) gaming.
I cloned the repo and then ran ...
1
vote
0
answers
34
views
C++ How to debug a WM/DE or X.org crash?
I have a huge code that deals with sockets, threads and processes and it is a complete mess... While editing recently, my WM crashed after I executed my code. Since every window is killed, I can't ...
0
votes
1
answer
255
views
How to avoid duplicate random number generation?
TL;DR:
A program draws the same random seed when started twice simultaneously. How did it happen?
Details
I'm running an MCMC statistical analysis, so I execute the program (phylobayes) twice to get 2 ...
0
votes
1
answer
323
views
Sending absolute events ABS_X ABS_Y using libevdev
I found little to no examples online about sending absolute events (EV_ABS) using libevdev.
I was able to create a device and send some keystrokes, but no luck with absolute events.
The device is ...
1
vote
0
answers
1k
views
error: *** A compiler with support for C++11 language features is required
I want to Build GCC 11 from source on Ubuntu 20.04.
I had some problems in making package for ROS and hence I decide to update my GNU.
my gcc and g++ versions are 11.1.0
when I extract the downloaded ...
0
votes
1
answer
459
views
How to make a path available for the entire system in Ubuntu
My tflite directory is as follows:
/home/me/tensorflow_src/tensorflow/lite/
However, I fail to import it in my C++ project:
#include "tensorflow/lite/interpreter.h" // getting a not found ...
1
vote
2
answers
116
views
Dealing with different prototypes of pipe()
According to this manpage, pipe() can have different prototypes depending on the architecture. If I want to be as cross-platform as possible, do I now have to write code that compiles when it is given ...
0
votes
2
answers
264
views
Cannot link to matlab libmat.so and libmx.so under Eclipse IDE
I am trying to compile matcreat.cpp under Eclipse C++ IDE. It allows to exchange matlab data with c++ programs. At some point I compile the program :
/*
* matcreat.cpp - MAT-file creation program
*
...
0
votes
2
answers
124
views
systemd service file closing socket
I need to run a C++ binary with systemd.
When I execute the binary directly or with a bash script it runs fine for days:
nohup ./testbinary &
./test.sh
test.sh:
#!/bin/bash
LD_LIBRARY_PATH="...
0
votes
2
answers
5k
views
Best way to run child process in C++ if you want to get output of the called command
I am writing an application in C++. In many places in my code I use system() function to run some commands. I am not sure this is an elegant solution and I would like to replace using this function by ...
2
votes
1
answer
332
views
How to split phyical input device into multiple virtual ones using PulseAudio/ALSA?
So i have audio interfaces with 18 input channels each. Data from these devices is fed through a C++ program using a library called PortAudio. Problem is that when i start going above 13 channels per ...
0
votes
1
answer
494
views
curl.h not found in manjaro
Everywhere people say you'll have to apt install libcurl. But I'm on manjaro and I have curl installed, there is no libcurl in the repo.
No idea what to do now.
In file included from ../main/main.c:1:
...
0
votes
0
answers
20
views
sqlite3 - how can I get `ALL FLAGS` used in compilation? [duplicate]
In short, I'm facing something very regular ?q=Expression+tree+is+too+large+(maximum+depth+1000).
Linux: Kali linux 2022.1 ( 5.15.0-kali3-amd64 )
Full: Linux kali 5.15.0-kali3-amd64 #1 SMP Debian 5....
0
votes
1
answer
3k
views
Specify which libstdc++ to use
I want to make use of a more recent GCC version. Therefore, I compiled GCC 10 and installed it into a non-standard directory /software/gcc10/. So far so good.
However, I am faced with problems when I ...
1
vote
0
answers
75
views
Tracking down symbols used by library in binary ELF as listed in memory map
I have an application written in C++ that crashed during exit. The reason for the crash is understood, there are references to different versions of the same library mixed inside the executable. This ...
1
vote
2
answers
3k
views
Finding out functions/variables used in the code from a given shared library
I'm analysing a large C++ project on linux platform(redhat), specifically the shared libraries used in it. How can I find which symbols(functions/variables) are used in this project from a particular ...
0
votes
1
answer
606
views
How to reload the configuration file as a systemd daemon (or service), upon receiving SIGHUP?
I am trying to write a systemD daemon for my program. While I was reading the Linux man page, I noticed a line:
If SIGHUP is received, reload the configuration files, if this applies.
My question is ...
2
votes
0
answers
295
views
X11 - Hide windows from screen cap
I'm aiming to hide X11 Windows from screen capture software such as discord/obs,
Within windows i am able to do this using SetWindowDisplayAffinity on windows, but on X11 i have struggled to find a ...
0
votes
2
answers
793
views
How to Send a Signal or Data to C++ Program from Bash Script
As the title states I would like a to be able to send a signal, alert, message, or something to a C++ program while it is executing from a bash script. I have seen some solutions where a script will ...
0
votes
1
answer
303
views
Adding new flags to custom Linux kernel
Recently, I've been trying to add a new flag to a custom Linux kernel that'll be used by mmap for educational purposes. I've successfully compiled and installed the kernel with this addition but the ...
0
votes
0
answers
116
views
shmat returns error (void *) -1 in selinux enabled rhel environment
as per the documentaion:-
If SHM_RDONLY is specified in shmflg, the segment is attached for reading and the process must have read permission for the segment. Otherwise the segment is attached for ...
1
vote
1
answer
3k
views
GCC and Clang can't compile C++ code
Trying to run command gcc code.cpp -o runthis
However it gives me errors in this format:
/usr/bin/ld: /tmp/cco6J3Vh.o: warning: relocation against `_ZSt4cout' in read-only section `.text'
/usr/bin/ld: ...
0
votes
0
answers
122
views
Access Input Control
I am currently trying to get into writing something like an autoclicker. I work on a openSUSE Leap with KDE environment and program in c++ or FORTRAN or python.
In order to do so I need access to ...
0
votes
1
answer
118
views
Schrodinger's cat
When I run a cat command as a background process,
$ cat &
and then try to kill it,
$ killall -v cat
it says that it killed cat with signal 15, but also that cat was only stopped. Upon running $ ...
0
votes
1
answer
292
views
Problem compiling ALSA project's pcm.c sample in raspberry pi zero OS
I am using a raspberry pi zero W with the latest raspberry pi OS
I have installed both libasound2 and libasound2-dev, and this code that I got off the raspberry pi forums for testing the alsa library ...
1
vote
1
answer
2k
views
How can I find the usb devices camera?
I am begginer in LINUX, sorry if my question isn't the best.
I have a c++ app that uses OpenCV lib. This app runs at startup via a service(using systemctl). My app needs as arguments, the id of usb ...
2
votes
1
answer
3k
views
How to read and consume the input of /dev/input/
I just started working with Ubuntu/Linux so my knowledge is limited.
My idea was to use a barcode scanner in my c++ program as an input device.
This works perfect when it comes to reading. I just open ...
0
votes
1
answer
2k
views
How to resolve shared library file errors while compilation [closed]
I'm compiling my project using Makefile & I'm getting the following error.
[rahul@wbms-dev wdb]$ make
/orasw/app/oracle/product/client_19c/bin/proc INCLUDE=/orasw/app/oracle/product/client_19c/lib ...
0
votes
1
answer
248
views
blockdev --getsize64 equivalent in c++?
Is there a function equivalent to blockdev --getsize64 in C++ to calculate /dev/block/sdb sizes without using system()?
from : Answer of Vojtech Trefny
#include <stdint.h>
#include <fcntl.h&...
4
votes
2
answers
1k
views
How to compile libstdc++ with specific compiler option?
I want to compile libstdc++ with the -fno-omit-frame-pointer option for profiling purposes, if possible. I was able to build libstdc++ by following https://gcc.gnu.org/install/index.html, but how can ...
1
vote
0
answers
1k
views
How to start using google tests on a Yocto(Open Embedded) System
I'm doing a project for ARM64 devices and am using Linux Embedded as the OS. I am trying to using Google Tests but when running bitbake, it is failing.
Heres the error:
| CMake Error at /#####/tmp-...
2
votes
1
answer
97
views
How to determine minimum supported OS version of my app?
Background
I'm making an C++ app that's supposed to run on Centos 7. Builds are being done on Centos 7.9, and I'm using C++11 and C++17 features, which limits backward compatibility with older ...