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
17 views

in vs code (c++) the terminal won't stop to take input

here is the code i have written, (no errors are shown) #include <iostream> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if (a<b) { if (a>c) {...
0
votes
1answer
28 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 ...
0
votes
1answer
19 views

colcon can not find my package

I have been writing some ROS2 code in C++ using colcon on Ubuntu 20.04, all has been working fine, up until now. colcon all of a sudden started complaining that it couldn't find my packages. When I ...
0
votes
1answer
39 views

Script does work properly right after the first run

I have a problem with running the same script right after its first run finished. The script looks like this: #!/bin/bash ./program1 & ./program2 & ./program3 wait Briefly, the inner three C+...
-5
votes
1answer
29 views

How can I name the output of a compiled source file in a certain way?

In terminal, I have compiled a source file named "file.C". I did this by typing g++ file.C -o file. Now, I'd like to know how can I use Unix commands to name the output as "helloworld....
0
votes
1answer
30 views

Is RH 7.2 compatible with C++14?

Is RH 7.2 compatible with C++14 ? any official doc please ? otherwise, with which version of RH, C++14 is compatible please ? thanks BA
0
votes
1answer
42 views

CentOS 8 Mingw Compile Error with cc1plus

I recently setup a fresh install of CentOS 8 to use the Mingw Compiler for C++ (I believe it's removed from CentOS 7). Everything was installed as follows yum -y groupinstall "Development Tools&...
1
vote
0answers
32 views

running c++ program from linux command line with programmer defined commands

I have a c++ program. I want to run it from command line and it has some inputs which I want to set them from command line with argv. like this: ./myprogram.out /ip:192.168.1.1 /password:2222 /user:...
0
votes
0answers
25 views

libcurl with ca_cert + private_key + cert_chain : working with OPENSSL but not with NSS

I'm writing an HTTP class (in C++) that abstracts the underlying implementation, and I want to be able to deal with a server using strong authentication. My implementation uses libcurl. The user of my ...
0
votes
0answers
22 views

Are /dev/i2c-1 and /dev/mem colliding?

I write a program which should handle a motion sensor and an ultrasonic sensor at the same time. I'm using a Jetson Nano with 40 GPIO-pins. The first one uses I2C interface and thus accesses /dev/i2c-...
2
votes
3answers
136 views

How to profile wall-clock time?

In my program, real time duration is sometimes as much as 3 times that of cpu time. This is a single thread application that does a lot of memory allocation and NFS base read/write. So my doubt is ...
0
votes
0answers
20 views

How do you read a .txt file with stdin .cc file and output it to your shell? pt.2 [duplicate]

//include file from a large library that gives us the ability to program in //C++ #include <stdio.h> #include <stdlib.h> // int main() { File * fPointer; //fpointer gives direction ...
5
votes
3answers
1k views

Why is this Mingw-w64 package so large?

Is it possible to install only x86_64-w64-mingw32-gcc? I need it for one command and the mingw-w64 installation is over 800MB... I'm in Debian Buster, but the same is true for other Linux flavors I ...
2
votes
1answer
32 views

How to debug application which is using /dev/port using gdb

I've got a simple C++ code to work with old ISA card fd = open("/dev/port", O_RDWR); if (fd == -1) { Error() << "Error fd = -1" << msg_show; return; } and also ...
0
votes
1answer
54 views

How can I make a geany .tags file for a C++ library?

I would like to have auto-completion on the geany text editor (no, it's not an IDE) and for that you use .tags files. There's a plugin that creates .tags files for your programs, but I need to make ...
0
votes
1answer
75 views

C++ linking error: 'libcairo.so: undefined reference to FT_Get_Var_Blend_Coordinates'

I'm trying to build a C++ project via CLion and have been unable to get past this error in the linking process: /lib/../lib64/libcairo.so: undefined reference to `FT_Get_Var_Blend_Coordinates' I'm ...
1
vote
0answers
39 views

Block any Screen Recorder from recording desktop in Ubuntu

I am using Ubuntu 18.04 I want to make a program that can block screen recording. I have tried 2 ways to achieve this 1. Using mandatory file lock in c++ #include<bits/stdc++.h> #include<...
3
votes
0answers
89 views

<filesystem> header library for gcc-c++ on AIX

I'm working on porting some code to AIX from Linux. The code makes use of c++17's header. #include <filesystem> ... std::ifstream is(path); if (!is.is_open() && std::filesystem::path(...
0
votes
1answer
27 views

C++ exe file won't update(Using Atom & MacOSX Terminal)

I'm using atom to write code in C++. When I compile my code in the terminal using g++ -Wall -std=c++14, it prints and compiles properly in the terminal. Any revisions to my code after the first print ...
0
votes
0answers
312 views

How to change clang-10, llvm-10, etc to clang, llvm, etc.?

I use Spacemacs, and installed llvm-10, clnag-10, clangd-10, and all related packages, in Debian 10. Used the following command to install llvm $ sudo bash -c "$(wget -O - https://apt.llvm.org/...
0
votes
0answers
127 views

How to change default compiler from clang to gnu gcc

I want to set default compiler from clang to gcc in termux (android application). gcc isn't available in official repo so I used pointless community repo. But now I can't configure the termux to use ...
0
votes
0answers
20 views

Perf: doesn't work for a process but works for others

I want to perf my process by using: perf record -p {pid} sleep 10 But it doesn't work and the perf report shows: Kernel address maps (/proc/{kallsyms,modules}) were restricted. │ ...
0
votes
1answer
141 views

Issue with /usr/include/pci/pci.h missing on CentOS Linux, make of C++ applications with g++ fails

I am working on a large C/C++ development project, we are using Red Hat Enterprise Linux (RHEL) 6 for our development network, and also using g++ and gcc and also gmake. Management directed us to ...
0
votes
1answer
109 views

How to build loadable builtins for Bash

As I recently learned, it's possible to dynamically load custom builtins into Bash (see enable in the manual, and this answer). However I'm not sure how to take advantage of this feature. The linked ...
3
votes
2answers
182 views

Capability inheritable for system() call in C/C++

Currently I'm trying to understand capabilities in Linux by reading http://man7.org/linux/man-pages/man7/capabilities.7.html I created a small C++ application with the capability CAP_DAC_READ_SEARCH+...
0
votes
0answers
91 views

libcurl4 crash while curl_easy_perform on Debian 10

libcurl4 (7.64.0-4+deb10u1) is installed on my Debian 10 system. I have a C++ project which I'm trying to run. I'm using CURL to GET response from a URL. As soon as I start my application, it crashes ...
0
votes
0answers
60 views

Unable to open 'start.S': Unable to read file '/home/abuild/rpmbuild/BUILD/glibc-2.26/sysdeps/x86_64/start.S'

I'm setting up and debugging a c++ program on opensuse system in VS Code. The debugger is working properly without any issues. But I get an error pop up saying Unable to open 'start.S': Unable to ...
0
votes
1answer
25 views

Why am I getting this 400 bad request?

I'm maintaining an old app in C++ that goes a http get request. However, the apache2 gives me a 400 error Error log [22/Mar/2020:20:04:33 +0000] "GET /hover/imr.php?=ADD_GAME%%16-0%%%43%6c%61%73%...
0
votes
0answers
75 views

How to set signal mask for child process started by bash

I have to set the signal mask for a C++ program/executable as workaround for a known issues by a bash start script. Known issues: Executable/C++ application has multiple threads (>1), the signal ...
0
votes
0answers
1k views

Resource temporarily unavailable

Question Why I'm got this error ?Resource temporarily unavailable How to launch over 10,000 threads with no error? I want to run my code with over 10,000 threads. Steps to reproduce this issue ...
0
votes
0answers
117 views

Shell - Redirection of Program Output to File not Working Properly

I'm trying to redirect the output of my program to a file. The program prints a few lines in the screen from time to time, and keeps proceeding like that until it terminates. When it terminates, the ...
0
votes
0answers
157 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
168 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
27 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
46 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
89 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
188 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
74 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
383 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 ...
1
vote
0answers
15 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
295 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
450 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
81 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 ...
1
vote
2answers
456 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
105 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
1answer
230 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?
2
votes
0answers
317 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
43 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/...
1
vote
1answer
4k 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
2k 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 ...

1
2 3 4 5 6