Stack Exchange Network

Stack Exchange network consists of 174 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.

3
votes
1answer
19 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
21 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
36 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 ...
-1
votes
0answers
14 views

error: no match for operator [migrated]

I do have this piece of code // Open the file infile.open(filename); if (!infile) { stockmsg << "InputData::read: Failed trying to open file " << filename << endl; ...
0
votes
1answer
37 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
78 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
84 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
63 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
109 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
56 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
32 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
26 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
325 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
85 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
90 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
76 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
114 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
22 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
26 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
232 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
46 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
104 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
44 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
705 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
214 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
53 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
52 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
74 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
0answers
405 views

how to install OpenGL header files in Arch Linux

I am using Arch linux and trying to learn GLFW with C++ . I need to include OpenGL headers in my program . I have following cmake file in QtCreator:- cmake_minimum_required(VERSION 2.8) ...
0
votes
2answers
605 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
24 views

cppman -c error

I installed cppman (which uses cppreference.com as its source to document c++) on arch linux, when I do cppman -c I get the following error: Caching manpages from cplusplus.com ... error: too many ...
0
votes
0answers
404 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++ ...
0
votes
0answers
478 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
0answers
331 views

What means tcpi_rcv_rtt parameters into tcp_info data?

The struct tcp_info define follow parameters which describe rtt functional: tcpi_rtt tcpi_rttvar tcpi_rcv_rtt What means tcpi_rcv_rtt parameter? The RFC 6298 operate only two state variables - SRTT ...
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
42 views

Unix stream socket blocks once the buffer is full

I have created a UNIX stream socket which buffers 10 messages. What happens when 11th message comes from a different process..Does my write() operation blocks? If that was the case, can you please ...
0
votes
0answers
109 views

Installation problem with hyperion

I’m tring to compile hyperion with this command i586-mingw32msvc-c++ Hyperion-1.0/Src/Crypter/*.cpp -o hyperion.exe and getting this error; can someone please get me out of this problem? i586-...
0
votes
0answers
85 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
523 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
34 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
0answers
202 views

Unable to cross-compile using rootfs as sysroot because of absolute links

I already posted this question (on Raspi.SE) and now realized that it might be more appropriate to ask here. I want to do a cross-compilation (for the Raspberry PI) of an application and prepared ...
0
votes
4answers
829 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
36 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 ...
0
votes
0answers
135 views

Monitoring shared memory segment

I would like to know, whether there is any existing mechanism to monitor a shared memory segment. To be more elobarote, consider a shared memory segment with a circular buffer accessed by many ...
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
28 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
644 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
130 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 ...