Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c++]

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

0
votes
0answers
9 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
0answers
47 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
23 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
49 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
36 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
29 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
91 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 ...
1
vote
1answer
31 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
0answers
40 views

Installing “iptables” in the remote machine

I have written a C++ program where I would capture the packets on the interfaces. Based on the packet values, I need to install iptables rules on the remote machine. For installing iptables on remote ...
0
votes
1answer
41 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 ...
4
votes
1answer
181 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
302 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
345 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
225 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
86 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
34 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
30 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
521 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
139 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 ...
1
vote
0answers
146 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
105 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
0answers
180 views

Mutual exclusion between all Linux threads and processes [closed]

I'm trying to write a piece of code that should not been executed simultaneously neither by threads of the same process, nor by different processes. In other words, I need global synchronization ...
0
votes
0answers
27 views

AWS Polly TTS issue

The SDK polly (text-2-speech) c++ application was working fine, but suddenly stops responding. The credententials are active. I am really stuck on this for the last 2 days, I could not able to move ...
1
vote
1answer
27 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
306 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
49 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
170 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
53 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 ...
0
votes
1answer
813 views

Playing with network interfaces in C/C++ [closed]

I've been looking for a way to manipulate network configurations. Required functions are; Set/get ip/netmask of an interface. Set/get route table information. Add/remove networks from/to route table. ...
1
vote
1answer
236 views

How to trace line by line by “gdb” C/C++ code? [closed]

I have installed gdb and added -g option to my compilation command, but when I try (gdb) s or (gdb) n it says: The program is not being run. It only works when I try (gdb) r and goes and stops ...
0
votes
0answers
82 views

Why does htop start so quickly?

I tried to read info about processes from /proc/ just like htop and top do. It seems like the value for "CPU%" in htop or top is calculated by summing up the values utime and stime in the stat file ...
-2
votes
1answer
53 views

How to schedule a C program to execute at a certain time then email output?

How would one go about scheduling a C program to execute at a certain time, then email the output to someone upon completion? I'm personally working in ubuntu, but even a general answer would be great ...
0
votes
0answers
83 views

Unable to install codelite on deepin 15.5

The following packages have unmet dependencies: codelite : Depends: libclang1-3.4 (>= 3.2) but it is not installable Depends: libgstreamer-plugins-base0.10-0 (>= 0.10.0) but it is ...
0
votes
1answer
1k views

Can't link opencv libraries via Cmake in Linux

I used to have OpenCV3 from the Arch Linux pckage manager(pacman) and it worked fine but when I removed it and install OpenCV 3.4.1 and OpenCV-Contrib from source code nothing worked even the old ...
0
votes
2answers
776 views

How to use sed in a loop to input variable values?

So I am trying to do this for practice just to get an understanding but if I have a code in say test.cpp and I want to change a line in the program say "CONST N = 10" that changes the value of N to ...
0
votes
0answers
479 views

Building newer GDB failed due C++11

I run 32 bit Centos Linux with gdb ver 7.2 on it. I need to update GDB. I got errors below while building GDB 8.1: checking whether g++ supports C++11 features by default... no checking whether g++ ...
1
vote
0answers
532 views

g++46: error trying to exec 'cc1plus': execvp: No such file or directory

I'm on FreeBSD 9.2. The gcc version is 4.2. My project needs c++11 so I install gcc 4.6 and in Codeblocks I change the build option to support c++11 and in toolchain section I write g++46 and gcc46. ...
0
votes
3answers
1k views

Which free compiler implements C++14 new features? [closed]

I want to use the new features of C++14 on Linux. Which free compiler grants these features?
0
votes
0answers
90 views

Shared buffer for user space processes

Currently Im implementing a shared buffer between user space processes. For that, I have a library which opens a client UNIX socket for the client processes to dump events into the server socket. My ...
1
vote
1answer
66 views

Run C++ program across computer on network

I have a c++ program that is multithreaded. I believe the throughput would increase if I could run it in the other computers connected by a switch. All of then are using the same OS(Ubuntu). Is there ...
2
votes
1answer
656 views

Why do I have to set LD_LIBRARY_PATH before running a program, even though I already linked the library locations in the compile stage? [duplicate]

I am compiling a model using make; the model has a Makefile that connects the source code with dependent libraries via flags that look like -L/lib1 -L/lib2. But when I try to run that model, it fails ...
1
vote
3answers
35 views

Can i use my tools without rebuilding them after a debian upgrade?

I am wondering if i have to recompile/rebuild my tools that i had built from sources previously, after an upgrade of Debian from Jessie to Stretsh. My mains tools are: Omnet++ network simulator (...
0
votes
4answers
1k views

/bin/sh returns 0 when it did not find a command in an if statement, is that expected?

I wrote a C++ watchdog that runs a set of scripts to determine whether there is a problem on that system. The code is a bit hairy so I won't show it here, but it is equivalent to a system call as ...
0
votes
1answer
37 views

Making Download & Install Style Programs for Linux

I am looking for a way to create download-and-install style programs for Linux. To clarity what I mean by "download & install", I mean that the installation process proceeds like this: User ...
2
votes
1answer
1k views

Fedora 27 /usr/bin/ld: cannot find -lstdc++

I have Fedora 27. I am building something from source. (It is https://github.com/xmrig/xmrig-nvidia if that matters). Make gets to linking and then fails with this message: /usr/bin/ld: cannot find -...
1
vote
1answer
32 views

How to use development package installed by sys package manager?

I'm confused as to how to use *-dev packages in Ubuntu. I want to use the libxml2 library, in Ubuntu, for my own code development. I installed libxml2-dev using apt-get, which put the header files ...
2
votes
1answer
758 views

Meson doesn't find the Boost libraries

I want to use Meson to build a new c++ project. The first thing I need is a dependency for the Boost library. But though the Boost libs are installed on my Arch system (headers and libs), Meson ...
1
vote
1answer
147 views

OpenCV based programs optimization embedded linux OS [closed]

I'm building my own Embedded Linux OS for Raspberry PI3 using Buildroot. This OS will be used to handle several applications, one of them performs objects detection based on OpenCV (v3.3.0). I ...
-1
votes
1answer
646 views

Is using system() function inside C++ code a fast way as using source codes? [closed]

As I know I can use system() function to using Linux terminal's commands inside my C++ code. For example system("aplay sound.wav");. I don't know can I write all the Linux commands like this or not, ...
0
votes
0answers
26 views

How can root password prompt be suppressed?

I am running service --status-all on CentOS 7 (service ver. 1.1) and one of the init.d script is prompting for root password. It is doing so, because the init.d script calls another script, which ...