2022 Developer Survey is open! Take survey.

Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
0 votes
2 answers
38 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 * ...
user avatar
  • 1
0 votes
0 answers
11 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 ...
user avatar
  • 101
0 votes
2 answers
17 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="...
user avatar
-1 votes
2 answers
43 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 ...
user avatar
1 vote
0 answers
15 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 ...
user avatar
  • 11
0 votes
1 answer
27 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: ...
user avatar
  • 321
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....
user avatar
0 votes
1 answer
102 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 ...
user avatar
  • 605
0 votes
0 answers
26 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 ...
user avatar
  • 1
1 vote
0 answers
21 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 ...
user avatar
0 votes
2 answers
85 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 ...
user avatar
0 votes
0 answers
95 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 ...
user avatar
2 votes
0 answers
35 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 ...
user avatar
0 votes
0 answers
104 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'...
user avatar
0 votes
0 answers
190 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, ...
user avatar
0 votes
2 answers
227 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 ...
user avatar
0 votes
1 answer
53 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 ...
user avatar
  • 1
0 votes
0 answers
35 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 ...
user avatar
0 votes
0 answers
59 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 ...
user avatar
0 votes
1 answer
639 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: ...
user avatar
0 votes
0 answers
56 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 ...
user avatar
0 votes
1 answer
51 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 $ ...
user avatar
0 votes
0 answers
153 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-...
user avatar
  • 169
0 votes
1 answer
64 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 ...
user avatar
  • 169
2 votes
1 answer
185 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 ...
user avatar
  • 39
1 vote
1 answer
741 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 ...
user avatar
0 votes
0 answers
34 views

Diagnosing cause of a process using 100% CPU

I'm trying to diagnose a strange error occurring on a fairly stripped-down Celeron N2930 (quad core Atom) PC running a Qt Quick based Application on top of Debian 10 Linux 32-bit (think basically a ...
user avatar
  • 161
0 votes
1 answer
263 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 ...
user avatar
  • 103
0 votes
0 answers
40 views

Multithreading Prgram in C++

I am running the following multi-threaded C++ program: #include <bits/stdc++.h> #include <algorithm> #include <ctime> #include <ratio> #include <chrono> #include <...
user avatar
-1 votes
1 answer
59 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&...
user avatar
2 votes
1 answer
170 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 ...
user avatar
  • 125
1 vote
0 answers
332 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-...
user avatar
2 votes
1 answer
50 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 ...
user avatar
  • 121
0 votes
0 answers
92 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=...
user avatar
0 votes
0 answers
322 views

D-Bus in Linux inside a Docker container under Jenkins

As the caption may suggest, this is quite a specific question. I have a Docker container image based on Debian Stretch, meant to be used as CI pipeline, launched by a Jenkins task. The software the ...
user avatar
  • 145
0 votes
0 answers
31 views

how to signal widget flags in glade C++

I have a small C++ glade application that opens up full screen. It has a button on the main window that when clicked it opens another independent C++ glade blank form with exit button. My problem is ...
user avatar
  • 1
0 votes
0 answers
29 views

Initialize SSD by sequentially updating all avaible sectors

I am programming an SSD benchmark for studying purpose. I want to measure kind of a ssd page size (clustered page size). There is this pseudo-code I can use: int F = open("/dev/sda", ...
user avatar
  • 101
0 votes
1 answer
765 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 ...
user avatar
0 votes
0 answers
25 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 ...
user avatar
  • 101
0 votes
1 answer
308 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 ...
user avatar
  • 1
0 votes
1 answer
114 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 ...
user avatar
  • 1
0 votes
2 answers
210 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.
user avatar
0 votes
1 answer
539 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 ...
user avatar
  • 113
0 votes
2 answers
61 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 ...
user avatar
  • 115
1 vote
0 answers
76 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'...
user avatar
  • 11
0 votes
0 answers
29 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 ...
user avatar
2 votes
0 answers
397 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 ...
user avatar
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 ...
user avatar
0 votes
0 answers
429 views

Why I can't compile cpp file using gcc to be 32 bit?

linux 64 bit and while trying to compile my cpp file I receive an error would appreciate any help, thank you The gcc command gcc -m32 -g mmn12-q2.cpp -lstdc++ The error: /usr/bin/ld: skipping ...
user avatar
0 votes
1 answer
36 views

How can I know whether a bunch of header file are part of a "standard" C++ toolchain on Debian

I have a build that fails, it complains about the lack of the following header files: /usr/include/Availability.h /usr/include/AvailabilityInternal.h /usr/include/_types.h I know for sure that my ...
user avatar

1
2 3 4 5
7