how do I set Clang 9 as the default C++ compiler on Ubuntu 19.10? I searched the internet, but nothing helped. Thank you for answer :)
I am trying to find a way to detect the event of a window (any window) being opened in Ubuntu 16.04
I would like to be able to detect the "window open" event and check if the opened window was my sought window and thereafter run a bash script or a C/C++ function.
So far I've found that I can use wmctrl -l
to find which windows are already opened. I could use this command and perhaps grep
to find if my sought window is opened and then act on this information.
I'd prefer not to poll, as I'd not want the application to stand idle when the window opens. The action should be as "instantaneous" as possible.
Is there an event or signal I could listen for to achieve this? From the kernel, window manager (Compiz) or maybe some log file that changes?
EDIT: To clarify, I have an application (not under my control) which might show a window at any time, this window does not have a title but it does have the WM_CLASS set (the WM_CLASS is the same for all windows of the application). I want to act upon the event that this window is shown (or created, whichever is best/easier).
It doesn't seem like the window is opened "within" the main applications window. Using xwininfo -children -id <window-id>
shows that the main application and the sought window are on different branches, connected to "the root window".
The branches looks like this, where R is "the root node"; A is a root node of the main application's branch and Y is the root of the branch with sought window W:
R
/ \
A Y
/\ \
B C X
\ \
Q W
So I'm hoping that I can find the unique structure of Y-X-W
I'm not sure I have to listen to all windows, but it is my assumption that I'll have to check what happens within "the root window" and try to find the sought window.
I'm attempting to write a program and I keep getting this error:
Fatal error: gl/glut.h: no such file or directory
I've read through other similar problems that people were having, and nothing has worked for me. What can I do to solve this problem?
Sorry, this is such a beginner question, but I've recently begun programming with C++ on Ubuntu 12.10 and I've installed a few libraries I need to work with, for example PCL and I can't find them to add them to my project. I'm using Qt Creator as the IDE and qmake
which comes with it.
For example, with PCL, I followed the instructions on their site:
sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all
And as no problems occurred I have to assume they are correctly installed.
Most of the tutorials dealing with adding external libraries I've found on the web assume you're on Windows and know where you downloaded the library.
Since I don't have experience with adding external libraries in C++, could someone please tell me in what file, if there is one, are libraries installed by default in Ubuntu?
What is the extension of these library files?
Is there a script/command which can help detect a library or all the libraries installed?
I do not want to discuss about C++ or any programming language!I just want to know what am i doing wrong with linux ubuntu about compiling helloworld.cpp!
I am learning C++ so my steps are:
open hello.cpp in vim and write this
#include <iostream.h>
int main()
{
cout << "Hello World!\n";`
return 0;
}
So, after that i tried in the terminal this
g++ hello.cpp
AND the output is
hello.cpp:1:22: fatal error: iostream.h: No such file or directory
compilation terminated.
What do you suggest? Any useful step by step guide for me?Thanks!