Questions tagged [c++]
C++ is a general-purpose programming language.
756
questions
0
votes
0
answers
22
views
C++ threads fail on ubuntu 22.04
Given this bug.cpp file:
#include <thread>
int main() {
auto t = std::thread([] {});
t.join();
return 0;
}
And this docker container:
FROM ubuntu:22.04
RUN sed -i -e 's/^APT/# APT/' -e 's/...
0
votes
0
answers
16
views
run visual Studio sln file in ubuntu
I have a project of c++ with .h files which were made in windows visual studio and have .sln file also, Now I want to run the whole project in ubuntu, I actually want to run the .sln file here so that ...
0
votes
0
answers
18
views
Xlib XSetWMHints not working as intended on Ubuntu 20.04 LTS [closed]
I am building an application using ROOT (CERN). At some point, I try to set an icon for my application in the taskbar with a function TGX11::SetIconPixmap. However it seems that the underlying ...
0
votes
0
answers
29
views
I'm trying to install "libc++" but I have many dependency problems
I was trying to install libc++ and I got this output: https://pastebin.com/P9vkaycR
What am I supposed to do to fix this besides following each dependency chain individually (which would probably take ...
0
votes
0
answers
17
views
Update system gsettings programmatically in C++
I'm running a service that needs to update the system wide proxy settings on Ubuntu.
$ gsettings set org.gnome.system.proxy.http host 'my.proxy.com'
$ gsettings set org.gnome.system.proxy.http port ...
1
vote
1
answer
54
views
How to git clone (done), Cmake build (almost done) and run a C++ Project in Ubuntu
This is my first day in Ubuntu (20.04.4 LTS) for C++ development. Previously I only used Windows, and find something new to work with. I would appreciate your support.
After cloning a github repo, I ...
0
votes
1
answer
24
views
I have been trying to make a custom shell with C++. It is working but it doesnot work when Pipe or > are given in the terminal
#include <iostream>
#include <cstring>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
using namespace std;
int main()
{
char exitC[] = "exit&...
1
vote
1
answer
127
views
Magick++.h: No such file or directory (Even after installing Magick++)
I am using a WSL Ubuntu terminal.
I executed the following command to install Magick++:
sudo apt-get install libmagick++-dev
After this, I checked to make sure that Magick++.h has been installed or ...
0
votes
0
answers
27
views
Executing a C++ code in directories with specific name through bash script
I have a directory, named test, with 10 folders, named folder1, folder2, etc., and each folder has subfolders named trial01, trial02, trial03. Now I have a master C++ file, named mastercfile.cpp, ...
2
votes
0
answers
274
views
C++ fmt library not working
Hi guys I'm a C++ beginner and I just found that the fmt lib is really interesting. But I ran into a problem when trying to use it. I used homebrew to install fmt lib brew install fmt .I check the fmt ...
0
votes
0
answers
80
views
insmod: ERROR: could not insert module ./gspca_kinect2.ko: Unknown symbol in module
I tried to compile and run the driver "gspca-kinect2" because I want that my kinect 2 is detected as webcam inside obs and skype,but as u can see below,it does not work :
marietto@marietto-...
0
votes
0
answers
21
views
error in terminal while running C++ program in eclipse
I am trying to run simple "hello world" program in eclipse in ubuntu 20.04 but i am getting error. Before my eclipse was running fine and i was able to run successfully all programs but i ...
-5
votes
1
answer
53
views
Coding on VS code [closed]
Hello this is my first time to learn C by a book
But The code doesn't give output
I installed build essential
What should I do ?
int main()
{
printf("Hello World!");
}
0
votes
1
answer
96
views
Where do software get installed on Linux? What is the difference between /opt and /usr?
I would like to clarify the software application and libraries installation philosophy and best practices in Linux. From my understanding from the Filesystem Hierarchy Standard (FHS), new software ...
0
votes
0
answers
104
views
problem in running c++ 17 code
With these two commands
sudo apt-get update
sudo apt install build-essential
I install c++ compiler and it has GCC/g++ version 10,than I install VS-Code and install two extensions code-runner and c++ ...
0
votes
0
answers
467
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'...
0
votes
0
answers
37
views
How to use .so files
I recently downloaded a SDK (written in C) from a device distributor and try to compile the code. As I do so, the output is
/usr/bin/ld: FILE: undefined reference to 'FUNCTION'
I assume that some ...
0
votes
0
answers
67
views
SDL2 can not initialize sound driver
|Distributor ID:|Ubuntu|
|Description:|Ubuntu 21.04|
|Release:|21.04|
|Codename:|hirsute|
I tried to initialize the sound driver but it didn't work. Here's the code:
std::cout << ...
1
vote
1
answer
146
views
/usr/include/x86_64-linux-gnu/sys contains only broken symbolic links
My O/S is Ubuntu 20.04.
The initial problem: I was trying to run a "make" and got errors like:
/usr/include/sys/cdefs.h:453:10: fatal error: bits/long-double.h: No such file or directory
...
2
votes
0
answers
136
views
problem with making a c++ project with G++
I am trying to build cascade library using G++ 8.3.0. In the documentation they mention that it was tested on G++ 4.7.2. My question is, is it necessary to downgrade to 4.7.2? if so could you please ...
0
votes
0
answers
31
views
Capturing login data input by user while logging onto Linux
I am trying to work on this user authentication problem where user enters the login data upon Linux boot, but the authentication takes place through a different connected device for security purposes ...
0
votes
0
answers
735
views
Cmake can't find gcc compiler
I have Ubuntu 18.04.6 LTS and I am trying to install and run gcc v8 (a v7 version is the default).
I have done:
sudo apt-get install build-essential
sudo apt-get install gcc-8
To try to get the v8 to ...
1
vote
0
answers
573
views
Unable to correct problems, you have held broken packages while installing gcc
i can't install this on my Ubuntu 20.04 LTS
:~$ sudo apt install gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be ...
0
votes
0
answers
109
views
Unable to correct problems, you have held broken packages. when installing c++ [duplicate]
So I'm trying to install c++ and I keep getting this error
sudo apt install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not ...
0
votes
1
answer
186
views
Difference between packages libxml2-dev and libxml2
I have simple C++ application that uses libxml2 library. For this purpose I need to install it. But which package I need to install:
sudo apt-get install libxml2
System still complains regarding ...
0
votes
1
answer
71
views
How to fix the X Window System error coming when running a c++ GTK program
I am getting an error while running a program written in c++ in GTK. The program stops when this error appear. I am a beginner and i have no idea what to do for this. The error is as follows.
(main:...
0
votes
1
answer
324
views
Upgrade gcc version in Ubuntu 18,04
I'm running Ubuntu 18.04 in WSL, which I use to compile my c++ programs.
I need to write a program that gets the name of all the files in a certain directory and adds them into a vector of strings. ...
0
votes
0
answers
69
views
How to build a .deb package for the c++ gtk program
I created a c++ program using gtk and glade. I need to build a .deb package for this program. This program saves data to MySQL database and also it exports data to a excel file using libxlsxwriter ...
2
votes
1
answer
326
views
Cross compile C/Cpp application for target ARM arch support ubuntu18.04 32-bit, on host machine i.e. ubuntu 18.04 64-bit machine using cross compiler
Trying to achieve the below task
Cross compile C/Cpp application for target ARM architechture supports ubuntu 18.04 32-bit on a host machine i.e. ubuntu 18.04 64-bit machine using cross compiler.
...
1
vote
1
answer
756
views
Netbeans 12.4 C/C++
I need to build C/C++ projects on Netbeans 12.4 with Ubuntu 18.04. There have been a long list of failures - trying earlier versions of Netbeans and even Eclipse. I can't find a simple tutorial / ...
0
votes
0
answers
28
views
How to detect that a C/C++ file is using windows specific stuff
Basically I want to test files/libraries/code in general that wont run on Linux by detecting windows specific includes, program calls, dynamically linked libraries at runtime, anything that isn't ...
1
vote
1
answer
132
views
can I install wiring pi libraries on my desktop linux PC?
I have a project I'm working on, that will eventually be a raspberry pi running Ubuntu also, but right now I just want to write code that includes wiringPi.h, and wiringSerial.h
I tried installing ...
1
vote
2
answers
3k
views
bad cmake executable vscode
I've recently freshly installed Ubuntu 20.04, and VSCode, meant for c++. I added the C/C++, CMake and CMake Tools extensions. Then I cloned one of my old github repos for testing and tried to Cmake:...
0
votes
1
answer
144
views
Can't compile project in c++, regardless of IDEs
I have been having problems with running c++ programs on ubuntu 20.04. The problem is, that even I write legit code that the compiler can understand, the same error occurs saying that "Error: ...
-3
votes
1
answer
362
views
I can't run C++ code
I Can't Run Program
Error message :
Here's the code:
#include <iostream>
using namespace std;
int main()
{
cout << "C++";
return 0;
}
0
votes
1
answer
299
views
I Can't Compile C++ Program
When I run the command gcc CCC.Cpp I get this error:
CCC.Cpp: file not recognized: file format not recognized
Collect2: error: ld returned 1 exit status"
This is the content of CCC.Cpp file:
#...
-1
votes
1
answer
4k
views
C++ Undefined reference to a function
I am using ubuntu 16.04 When I try to compile the program with
g++ -g main.cpp -o main
This is my g++ version
g++ --version
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software ...
1
vote
1
answer
243
views
How can I make the C++ compiler support template for STLin order to install hpctoolkit?
I am trying to install hpctoolkit using Spack. In order to do that, I executed :
git clone https://github.com/spack/spack.git
cd spack/share/spack
source setup-env.sh
spack fetch -D hpctoolkit
spack ...
1
vote
1
answer
703
views
I am getting error about X11 library
when I run cmake build I get this error:
CMake Error at cmake/Macros.cmake:296 (message):
Missing item in X11_X11_LIB;X11_Xrandr_LIB
Call Stack (most recent call first):
src/SFML/Window/CMakeLists....
0
votes
1
answer
1k
views
main.cpp:1:10: fatal error: Sort.h: No such file or directory
I want to write makefile to compile my C++ codes.
The tree of my files is this:
.
├── include
│ └── Sort.h
├── lib
│ └── Sort.cpp
└── src
├── main.cpp
├── makefile
└── obj
And this is ...
-1
votes
1
answer
90
views
Run easy c++ program with Anjuta -> compiler cannot create executables?
I'm currently trying to use Anjuta to get familiar with C++. I tried to run a simple Hello World program in the main.cc-file:
#include <iostream>
int main()
{
std::cout << "Hello ...
0
votes
1
answer
88
views
Reliable way to find application icons?
I'm creating an app in Qt Creator and C++ that lists all apps on the system by indexing .desktop files from /usr/share/applications and ~/.local/share/applications. In almost every icon path, I don't ...
1
vote
1
answer
1k
views
aarch64-linux-gnu-gcc: error trying to exec 'cc1plus' : execvp: No such file or directory
I am trying to build a C++ file with aarch64-linux-gnu-gcc for Raspberry Pi 3 64 bit and I am running this command :
aarch64-linux-gnu-gcc -mcpu=cortex-a53 test.cpp
But I am getting this error:
...
1
vote
0
answers
52
views
notification from c++ privilege daemon process to all users
I have a c++ privileged daemon process which is running as root. Want to send notification to all the desktop users programmatically using libnotify-dev package.How can it be done in cleaner way.
0
votes
1
answer
44
views
How to compile multiple all testbench components of Systemc
I have been trying to simulate all my testbench components of hierarchiral full adder systemc program. Previously, to simulate a simple systemc filenamed(hello_world.cpp) I have used:
$ g++ -g -Wall -...
0
votes
0
answers
57
views
Alternative for mouseclick function in Linux?
So i got some problem with my window and i decide move to linux. I'm working with some c++ code that required windows.h, so i decide to change some of my code, so it can run in linux.
one of my code ...
0
votes
0
answers
62
views
Cmake build from source gives problems on make (probably c++14 standard not used)
I just updated my Cmake to the version 3.19 (previously 3.10) from sources. For this I now have two cmake versions the one from before in /usr/bin/cmake and the new one in /usr/local/bin/cmake which ...
0
votes
1
answer
181
views
Header file path
I have installed libxml2 on my machine:
sudo aptitude install libxml2
But I can't find header files. Where header files are located?
3
votes
1
answer
280
views
How to install github.com/ioi/isolate on Ubuntu
I recently tried to make a C++ judge and heard about a tool called "Isolate" (available here):
Run program within a sandbox, so that it cannot communicate with the outside world and its ...
0
votes
1
answer
330
views
Where did QT install to?
I am trying to set up a qt project in CLION. I installed qt using these commands
sudo apt-get install qtcreator
and
sudo apt-get install qtdeclarative5-dev
When you create a qt application in clion ...