A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
0answers
35 views

Linux mint | methods are missing from ncurses

I lately installed a linux mint distribution for development... Later on i installed curses, ncurses and ncursesw by using following commands... sudo apt-get install libncurses-dev sudo apt-get ...
1
vote
1answer
44 views

Is it possible to copy files from a Host os to a Guest OS which is running in the virtualbox ? (Not Folder sharing)

As per my understanding there is an option called Shared Folder. But I am not referring to that. Here my Guest OS is Linux and my Host OS is windows. I am using virtualbox to run the Guest OS. I need ...
2
votes
1answer
26 views

Moving a Compile/Make project from old RedHat 5 (CentOS) to modern Ubuntu/Mint

So I have a little learning project that I am currently working on. I have a project/program that is compiled up from multiple *.cpp *.hpp etc files. This project (actual bin-executable) is built ...
0
votes
1answer
25 views

Library stability across different major and minor versions

I'm building a shared library from my C++ code on RHEL A.B (Major version is A and minor version is B). In how many of the below scenarios this shared library is guaranteed to work in a stable, ...
1
vote
1answer
59 views

How do I display a graph in root with Linux on chromebook?

I am extremely new to Linux and I'm using the Chromebook's Linux beta which I believe is ubuntu. I'm trying to use CERN's root software to display a function's graph but it gives me a massive error ...
0
votes
1answer
57 views

Normal user run Qt C++ program as root without sudo?

I am writing a robotics program in C++, using Qt for the GUI, where each thread needs access to hardware. The library which accesses the hardware is called pigpio, and it modifies /dev/mem, so it ...
2
votes
2answers
58 views

Send signal from process to controlling terminal

I was wondering about a clean elegant way to do the following: Let's say I have written a C++ program, called foo, running inside as part of a shell script, called bar.sh. I'd like for the shell ...
0
votes
1answer
61 views

How to install your signal processor SIGUSR1 and SIGUSR2?

By default, user signals SIGUSR1 and SIGUSR2 terminate the process or thread. How to make them set their handler? I tried to read various articles on this topic, but since I am new to this topic, it ...
0
votes
0answers
14 views

when will systemd consider my service/application has started

I'm writing an application and use systemd to auto start it as the 1st service. There is some other application which also runs as a service and I want the 2nd service start after my 1st service. [...
0
votes
1answer
40 views

Clang++ Compiles, but doesn't run

I try to compile a program by typing (lets assume here I'm cd'd into the directory) clang++ file_name.cpp. It compiles and should autorun, but it doesn't, and just ends the event, and opens the ...
-1
votes
1answer
152 views

linux keyboard input logging - keymap translation [closed]

I am writing a class that monitors input events on linux. It'll be used in a daemon that acts upon a user's keypresses in gui programs to give visual feedback on a usb led device. I use input events ...
2
votes
1answer
65 views

Using C++ in the GNU/Linux world [closed]

As a C++ developer working with embedded systems, it's very difficult for me to stay in the C++ "mindset" when working regularly with Linux APIs. For example, I may wish to use libudev, which uses ...
0
votes
2answers
83 views

Retrieve USB device information for drive which provides specific mount point

I am writing a C/C++ tool which needs to do the following: Detect when a new mount point has been mounted. ✔ Find out which (USB) device provides this mount point. ❓ Get the USB vendor ID and product ...
0
votes
1answer
49 views

Child process killing itself but becoming zombie

I need to turn on a GPIO on my Raspberry Pi for a certain amount of time, so I made a function creating a child process, turning the GPIO on for some time then off. Problem is, when I try to make the ...
0
votes
0answers
34 views

How to specify cryptopp library paths in geany IDE for c++

I've written a code in visual studio 2019 in c++ language and it involves various cryptographic mechanisms. It also includes Elliptic curve library named cryptopp. I want to simulate and test the ...
0
votes
1answer
156 views

Restrict child process 's cpu and ram usage by parent process using C/C++ in Linux

I am trying to create child processes from parent processes.I want to restrict CPU and RAM usage of the child processes using C/C++.Is there is a way to do it?
1
vote
0answers
125 views

How to provide user access to /sys/class/backlight/acpi_video0/brightness programmatically (udev?)

I control backlight through /sys/class/backlight/acpi_video0/brightness with a script (via sudo) that provides a simple script to increment/decrement, set, retrieve and restore last backlight setting ...
1
vote
0answers
29 views

passing arguments to c++.bin

I am having the following issue when making HSAIL: [ 3%] Built target libhsail-includes [ 6%] Building CXX object libHSAIL/CMakeFiles/hsail.dir/HSAILScannerRules.cpp.o In file included from /home/...
0
votes
0answers
31 views

Using the system() function in C++ code

I am having a small debugging issue using C++ and TCF ( Target communication framework) in Eclipse IDE. Eclipse refuses to override / download running code with the latest build. So I need to remove ...
1
vote
1answer
1k views

Why is command line program killed by SIGABRT?

I've been using a command line program (installed via package manager) that was working fine until I used vim to inadvertently insert a null byte (^@) in one of the program's data files when doing ...
0
votes
1answer
667 views

installing eclipse/paho.mqtt c++ client on Debian

I'm developing a C++ program (for a home IoT Project) on Debian 9 that needs to act as an MQTT client. I found paho.mqtt would be helpful in this regard, but none of the on-line documentations to ...
2
votes
2answers
96 views

Pulse Audio on programming doesn't find all my devices

This problem ocured to me while I was writing a c++ program so I created a minimum instance of the code to clarify the problem better: #include <portaudio.h> #include <iostream> int main(...
11
votes
2answers
1k views

Why do I seem to lose data using this bash pipe construction?

I am trying to combine a few programs like so (please ignore any extra includes, this is heavy work-in-progress): pv -q -l -L 1 < input.csv | ./repeat <(nc "host" 1234) Where the source of ...
0
votes
0answers
21 views

Howto unload and load or reload translation files using gettext and the libintl library

In the Minetest game project there is the claim that one cannot use gettext because of the lack of dynamically loading translations. My question would be howto unload or reload translation files ...
0
votes
0answers
226 views

PulseAudio C++ API: How to play .wav file and control volume

I am trying to play .wav files using the Pulse Audio c++ API while also being able to control the volume of each sound. I have successfully played these files with ALSA, but could not figure out ...
0
votes
0answers
15 views

Readonly flag after error: why does Kernel detect an error?

I'm debugging a C++ application running on Linux Embedded: uname -r: 4.14.40 The application is downloading a file on an external flash SD card: mount: sd-path type vfat (rw,relatime,fmask=0022,...
0
votes
2answers
929 views

Problem due to incorrect libstdc++6

When I do sudo apt-get -f install I am getting Preparing to unpack .../libstdc++6_8.1.0-5ubuntu1~14.04_amd64.deb ... Unpacking libstdc++6:amd64 (8.1.0-5ubuntu1~14.04) over (5.4.0-6ubuntu1~16.04.10) .....
0
votes
0answers
80 views

C++ script on Spark Cluster throws exit status 132

I'm trying to run a c++ program on spark cluster by using the rdd.pipe() operation but the executors throw: java.lang.IllegalStateException: Subprocess exited with status 132. The spark jar runs ...
1
vote
0answers
124 views

seteuid fails even when all UIDs are 0

I have some C++ code on a Linux machine whose purpose is to run some code as an arbitrary user. #include <sys/capability.h> #include <unistd.h> void doAsUser(uid_t uid) { if (...
2
votes
1answer
265 views

C++ Build 32bit binary on 64bit system [closed]

So I have a project that I want to be able to build as a 64bit binary as well as as a 32bit one. My machine itself is 64bit and the 64bit compile works just fine. I am using cake to build my ...
-2
votes
1answer
53 views

How to write a script to kill & clean the resources of executing process?

I have an application running in c language (my_process.c) and a script (stop_process.sh) to stop the application and clean up all resources held by the process. In the application code, let's say I ...
3
votes
1answer
583 views

Adding Events to Udev Event Queue

One of my udev rules runs a script on removal of USB storage devices. This script performs some general cleanup and removes the mount point directory for the storage device. The issue is that I want ...
2
votes
1answer
102 views

ALSA Check if spdif plugged in / active

Is there any way in alsa / libasound to check whether the SPDIF In actually has a device connected? I'm currently using a Raspberry Pi with an USB sound card to merge the audio from my PC coming in ...
0
votes
1answer
48 views

Developing Mozilla Firefox for Linux on Windows

I would like to make some contribution to Mozilla Firefox (with the little C++ I know). Can I build, run and debug Firefox for Linux using WSL (Windows Subsystem for Linux) ? If yes, should I install ...
6
votes
1answer
1k views

Why are there multiple copies of header files in /usr/include?

I've been browsing my /usr/include folder trying to get acquainted with the layout and I've noticed that there are multiple copies of header files (at least by name, I didn't actually diff them to see ...
0
votes
1answer
1k views

Is it safe to send SIGUSR1 to a program, and why? [closed]

When you send SIGUSR1 signal (say the signal handler has been set in advance) to a program while it is executing sleep(100), the signal is caught correctly but sleep(100) is terminated just after the ...
1
vote
1answer
2k views

Building shared library which is executable and linkable using Cmake

How to create an executable shared-library using cmake? Something like: libtest.so :: linkable shared library libtest.so :: executable too Note: gcc/g++ options are known to achieve the ...
1
vote
1answer
1k views

Process id to loginctl session id

I am having one "small" problem :) If I run command loginctl list-session I will get output that will have columns session, uid, user and seat. So I have session here as c6, c2, c4, etc. Also, I ...
0
votes
1answer
215 views

deploy a c++ program with c++11 support in older CentOS machine

My program depends on libstdc++.so.6 which depends on /lib64/libstdc++.so.6.0.19 But my older CentOS has libstdc++.so.6 => libstdc++.so.6.0.13 Questions Should I check the version of the libstdc++....
1
vote
1answer
46 views

WebSocket Protocol stumper [closed]

I am writing an embedded WebSocket server and working directly from the relevant RFC. My server responds properly to the upgrade request from the browser and the browser, in its example javascript, ...
0
votes
1answer
80 views

What RPM package do I need to install to have GObject documentaion available locally on RHEL 7

I want the documentation at https://developer.gnome.org/gobject/stable/index.html to be available on my local RHEL 7 machine in /usr/share/. What is the name of the package that I need to install?
0
votes
1answer
2k views

Using Mesa v18.0.5, but only getting OpenGL v3.0

I am trying to develop C/C++ applications using OpenGL. Unfortunately, I have been unable to access any functionality past OpenGL 3.0. I have Mesa version 18.0.5, Linux Mint 18 64-bit, the 4.18.1 ...
2
votes
2answers
344 views

Updating Linux system time programmatically

I have a system of 3 or 4 different Linux Ubuntu machines that I would like to be time synced. My plan is to use one of them (let's call it master) as the NTP server that serves time to the 3 other ...
2
votes
0answers
320 views

Why might rsyslog %syslogtag% display “(none)”?

Given the following lines in an instance of /etc/rsyslog.conf: $template MyFmt, "%timereported:::date-year%%timereported:::date-month%%timereported:::date-day%_%timereported:::date-hour%%timereported:...
2
votes
0answers
154 views

Root compilation in OSX with true GCC/G++

I need to compile ROOT with gcc/g++. I am having difficulty with the objective C libraries. If I link a true g++ (installed with brew) to the command gg++ and the same for gcc -> ggcc - I can start ...
1
vote
1answer
28 views

Is installation only copying some files in some specific folders? [closed]

I am interested to know when I install something like opencv for example, it just copies some files/folders in some folders/directories like usr/local/include or usr/local/lib? Or maybe some extra ...
-2
votes
1answer
502 views

Command line HMAC calulation is different from Node.JS crypto.createHmac('sha256')

In Node.js I use following code hash = crypto.createHmac('sha256', SECRET).update(fileContent).digest('hex'); to calculate HMAC. C++/Qt code analogue QByteArray hash = QMessageAuthenticationCode::...
2
votes
1answer
67 views

Why does linux recognise a C# .cs file as a C++ source file?

I used the file command on a c# source file, and linux thought it was a c++ file. What is the reason for this?
1
vote
1answer
569 views

Why is my program slower, despite using more threads? [closed]

I am new to threading , and I wanted to test my newly acquired skills, with a simple task, create an image using multiple threads, the interesting part is that , on a single thread , the program runs ...
1
vote
1answer
93 views

CentOS with nodeworx

I have a server CentOS 6.9 with interworx and I can't install libstdc++-static. When I do sudo yum install -y libstdc++-static returns with: No package libstdc++-static available. How can I ...