Questions tagged [c++]

C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

Filter by
Sorted by
Tagged with
1 vote
0 answers
13 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 ...
  • 179
0 votes
0 answers
9 views

Cannot draw using openGL on x11 created windows

Queried the available Frame buffer configs matching the desired buffer capabilities . Extract visual info from it. install the picked visual info colormap into x11 server build the X win. Build Glx ...
0 votes
1 answer
67 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
28 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 ...
0 votes
0 answers
198 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 ...
  • 3
0 votes
1 answer
70 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 ...
  • 143
1 vote
2 answers
79 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 ...
  • 13
0 votes
2 answers
90 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 * ...
  • 1
0 votes
0 answers
17 views

MacOS : ditto utility - does an equivalent library exists?

I am looking for an opensource library for the ditto utility. Basically I wanted to preserve all the extended attributes, ACL and every other stuff which could be associated with a file, saved and ...
  • 101
0 votes
2 answers
27 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="...
-1 votes
2 answers
1k 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 ...
1 vote
0 answers
68 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 ...
  • 11
0 votes
1 answer
167 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: ...
  • 351
0 votes
0 answers
19 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
630 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 ...
  • 633
0 votes
0 answers
52 views

Receiving an error..... Check 1 failed Output file not found rm: cannot remove 'average.dat': No such file or directory {"code":1,"response":null}

THE QUESTION STATES: The file ALE.csv contains the information shown in Table 1. Write a program to use the file to produce a text file containing the information in the file along with the winning ...
  • 1
1 vote
0 answers
35 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 ...
0 votes
2 answers
636 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
0 answers
230 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
69 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
0 answers
133 views

Undefined reference to libraries while building

I am trying to install tgs2apng in Ubuntu on WSL. As instructed I installed the 3 libraries- rlottie, libpng and apngasm. However When I run make I get undefined references to rlottie and apngasm Here'...
0 votes
0 answers
392 views

How to get vid and pid of usb device before authorize it

I am writing an application in C++ on Linux (Ubuntu) that can detect plugging USB devices. I am using libudev library to detect new devices and get some pieces of information about them, such name, ...
0 votes
2 answers
382 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
105 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 ...
  • 1
0 votes
0 answers
50 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 ...
0 votes
0 answers
94 views

64 bit Microsoft Visual Studio C++ 2015 Redistributable on linux

If a windows executable depends on 64 bit Microsoft Visual Studio C++ 2015 Redistributable, what is the best way to run that application in linux? I have run it under wine in the past with a huge ...
1 vote
1 answer
1k 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: ...
  • 13
0 votes
0 answers
61 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
59 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
0 answers
289 views

How do I generate a 1kHz pure tone using asoundlib ALSA API in C++ in raspberry pi OS?

I am following the sample code here to generate a pure tone sinewave using ALSA API in C++ in Linux: http://equalarea.com/paul/alsa-audio.html The code I am using is under "A Minimal Interrupt-...
  • 169
0 votes
1 answer
95 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 ...
  • 169
2 votes
1 answer
272 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 ...
  • 39
2 votes
1 answer
985 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
548 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 ...
  • 103
-1 votes
1 answer
103 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&...
2 votes
1 answer
261 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 ...
  • 125
1 vote
0 answers
542 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
57 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 ...
  • 121
0 votes
0 answers
136 views

httpd, avc: denied { unix_read unix_write }

I am new to selinux concept and here I am stuck on how to make httpd perform {unix_read unix_write} Below is the audit log message. type=IPC msg=audit(1624375715.312:4225): ouid=0 ogid=0 mode=0666 obj=...
0 votes
1 answer
977 views

Error: #error This file requires compiler and library support for the ISO C++ 2011 standard

I am running a c++ code with TAU (analyzing and profiling tool) on Ubuntu 20.04 LTS using some cluster. The command I am running looks like this: tau_cxx.sh -I$FFTW3_INC wrappingScript.cpp ...
0 votes
0 answers
27 views

MakeFile problem only have .Object files

As the title say i have a problem compiling so i have my makefile who compile great my .cpp , then I have .o in the bin directory but after that its off I stay with my .o files and nothing change , It ...
  • 101
0 votes
1 answer
438 views

Installation of clang not correct, always “segmentation fault”

I have recently switched to ubuntu (20.04.2 LTS) and have tried installing clang (and clang++). I did it with: sudo apt-get install clang and can find clang and clang++ in /usr/bin When I try to ...
  • 1
0 votes
1 answer
176 views

How to determine if the device is battery-less or not using c++ program

I have a requirement to determine if the device on which my c++ application is running is battery less or not. I didn't find a standard way to do this. I found some terminal commands such as upower -d ...
  • 1
0 votes
2 answers
330 views

Prevent computer from sleeping in C++

I need a way to prevent the computer from sleeping, turn it on/off at runtime. I believe SetThreadExecutionState does that for windows, now I am looking for a way to do that in Linux.
0 votes
1 answer
710 views

How long would it take to build GCC-10.2.0? [closed]

I'm building an LFS 10.1 system on a virtual machine with CPU Intel(R) Core(TM) i5-10210U CPU @ 1.60Hz(yes, it's a laptop) with 2 cores and 4GB of RAM. I'd like to know how long will the build process ...
  • 113
0 votes
2 answers
68 views

Dont kill program on illegal behavoir

I have a program which tried to use freed address. when it does this, It crashes. I think this happens because Linux terminates the program for wrong behavior. Is there any to way to run program in ...
  • 115
1 vote
0 answers
108 views

Store in a variable monitoring result of dd to use it in c++

I use this to monitor dd when i copy files. sudo dd if=$source of=$pathToUsb bs=4M conv=fdatasync status=progress 2>&1 | stdbuf -o1 tr '\r' '\n' | stdbuf -o1 cut -d' ' -f1 | sed -u 's/[a-z]*//g'...
  • 11
0 votes
0 answers
66 views

How to run binary at Linux start-up with sound?

I have a C++ program where I use the SDL2_Mixer module (which is based on Pulsesink, I think) to output audio. I want to run it on startup, but it does not want to work out very well. I set my default ...
2 votes
0 answers
490 views

Cannot open file with absolute path in Systemd Service

I have a .service which running my C++ application. My path is absolute path. It works when it is launch via command line but fails to open file when lauch via a systemd service. Output in service is ...
0 votes
1 answer
41 views

How to detect which files are created when running a command

I'm trying to understand what files or build artifacts are created by the build system of a C++ project. There are 3 steps to building this project: ./autogen.sh ./configure make Is there a way I ...

1
2 3 4 5
7