Hot answers tagged

36

You can do something like this. Assume Alice is the server. She types: mawk -W interactive '$0="Alice: "$0' | nc -l -p <port_number> <ip_of_alice> Then Bob connects to that server. He types: mawk -W interactive '$0="Bob: "$0' | nc <ip_of_alice> <port_number> The mawk lines just adds the prepending name of the person to the "chat"....


35

The answer is in your question: Try: sudo apt-get install <selected package> In your case: sudo apt-get install g++


33

Install clang-5 from llvm.org repositores First, we should add the llvm.org repositories to our sources lists, the line that we should add is: deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main Open nano and add the above line to this file: sudo nano /etc/apt/sources.list.d/llvm.list Add the repository key, it will make apt able to verify ...


29

Super mega GCC table for all Ubuntu versions: How do I use the latest GCC on Ubuntu? Ubuntu 16.04 and below There is an official Ubuntu GCC test PPA which should be preferred: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-7 g++-7 gcc-7 --version GCC 7 was release in May 2017, so too late for 17.04 main ...


25

You can already install gcc-7 and g++-7 from this package. sudo add-apt-repository ppa:jonathonf/gcc-7.1 sudo apt-get update sudo apt-get install gcc-7 g++-7


24

It is simple, as in the universal-ctags docs: git clone https://github.com/universal-ctags/ctags.git cd ctags ./autogen.sh ./configure make sudo make install


24

INSTALLATION Install oracle-java8-jdk: sudo add-apt-repository -y ppa:webupd8team/java && sudo apt update && sudo apt -y install oracle-java8-installer Install universal pre-requisites: sudo apt -y install g++ cmake cmake-gui doxygen mpi-default-dev openmpi-bin openmpi-common libusb-1.0-0-dev libqhull* libusb-dev libgtest-dev sudo apt -y ...


21

In Ubuntu the core dumps are handled by Apport and can be located in /var/crash/. But it is disabled by default in stable releases. To enable Apport, run: sudo systemctl enable apport.service or sudo service apport start. To disable, run: sudo systemctl disable apport.service or sudo service apport stop in order to back to regular core dumping method. See: ...


21

Try adding -std=gnu++98, it was probably the default for gcc 6.4.0. Example: g++ -std=gnu++98 hello.cpp -o hello


20

I found two ways of solving this problem. Use the xprop -spy -root _NET_ACTIVE_WINDOW command in combination with grep in a bash script. Create a C++ (could have been C or python as well my project was in C++ to begin with) application using the Xlib library to listen for events from the X-server. I ended up using alternative 1 but I'll provide some info ...


19

I have not tested it on Ubuntu 15.04 but this is how I installed it on Ubuntu 14.04 from a PPA. sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-5 g++-5 sudo update-alternatives sudo update-alternatives --remove-all gcc sudo update-alternatives --remove-all g++ sudo update-alternatives --install /usr/bin/...


18

The -c flag tells g++ to compile your source code to object code, but stop short of linking it with the necessary libraries to create a standalone executable binary. From man gcc: -c Compile or assemble the source files, but do not link. The linking stage simply is not done. The ultimate output is in the form of an object file for each ...


18

Since what seems to be the occasion to ask this question already has an answer, I am answering this question as an extended explanation on how it was done (in python) Basic static indicator Since Ubuntu Mate, from 15,10, supports indicators, there is not much difference between writing an indicator and a panel app for Mate. Therefore, this link is a good ...


17

Install clang version 9 from the default Ubuntu repositories in Ubuntu 19.10 and later. sudo apt install clang-9 /usr/bin/c++ is actually a symbolic link to: /etc/alternatives/c++ which in turn is also a symbolic link to: /usr/bin/g++ so on Ubuntu c++ is g++ and g++ is g++ explicitly. Set Clang 9 as the default C++ compiler using c++ so that build ...


15

To find out what compilers are installed, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below: dpkg --list | grep compiler


15

First you need to compile and link your program. Assuming the source code is saved in a file yourprog.cpp, you can do that using the GNU C++ compiler g++, for example g++ -Wall -o yourprog yourprog.cpp The resulting executable will be called yourprog and you can then run it using ./yourprog


14

The answer provided by https://askubuntu.com/users/22949/eliah-kagan did not work for Ubuntu 19.04 with NetBeans 11 since the C++ plugin is not available under "Netbeans Distribution" when I tried it. To install C++, I also had to select the Update Center labeled "NetBeans 8.2 Plugin Portal". It appears that C++ is not in the latest distribution yet, so I ...


13

The -mt suffix had been removed. The installed Boost libraries are multi-threading safe. You can compile your program versus libboost-thread. Either by changing the source to use non -mt libs or by making symbolic links libboost_thread.a →libboost_thread-mt.a. Same thing if you need shared libs .so.


13

clang --version See below: $ clang --version Ubuntu clang version 3.5-1ubuntu1 (trunk) (based on LLVM 3.5) Target: x86_64-pc-linux-gnu Thread model: posix


12

Whenever a compile fails with a missing file simply leverage the infrastructure to search for the missing ubuntu package apt-file search some_missing_file_goes_here # cmd 1 apt-file search X11/extensions/Xcomposite.h # cmd 1 which returns with libxcomposite-dev: /usr/include/X11/extensions/Xcomposite.h so solution is to install that missing ...


12

There's Eclipse available from the repository. You can install it with: $ sudo apt install eclipse Or by the GUI Search of the Ubuntu Software center. A search of the word "IDE" will bring up a significant number. You could also specify eclipse as the search criterion. Eclipse will most likely have more of the familiar functionality and features you've ...


12

If you run the installer with --help you should find that it has a --skip-license command line option: $ ./cmake-3.10.0-rc4-Linux-x86_64.sh --help Usage: ./cmake-3.10.0-rc4-Linux-x86_64.sh [options] Options: [defaults in brackets after descriptions] --help print this message --version print cmake installer version --prefix=dir ...


12

The package name is gcc-8, not gcc-8.1, so try: sudo apt-get install gcc-8 g++-8 As others mentioned, make sure you've added the toolchain test PPA: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update


12

It should work the way you want if you wrap the command in a command group or subshell: { time ./blur-effect 4k.png 4k_out16.png 16 15 ; } &>> Output.txt or (time ./blur-effect 4k.png 4k_out16.png 16 15) &>> Output.txt See Write output of time in a file, why are parentheses needed?


11

First of all, it is 8192 kilo bytes, and not bytes. Furthermore stack is one thing, variable is another, and heap yet another. See this explanation of differences between stack and heap, for example, or this page. As far as I know stack is used for local and short lived variables, and it depends on the compiler whether stack or heap are used. As far as I ...


11

There are a number of libgsl packages, as shown by an apt-cache search: $ apt-cache search libgsl libgsl0-dbg - GNU Scientific Library (GSL) -- debug symbols package libgsl0-dev - GNU Scientific Library (GSL) -- development package libgsl0ldbl - GNU Scientific Library (GSL) -- library package libocamlgsl-ocaml - GNU scientific library for OCaml libocamlgsl-...


11

Okay so this is how I did it. First install libnotify-dev: sudo apt-get install libnotify-dev this will install the lib on your system and put the headers of the lib to /usr/include/libnotify/ You can take a look at the header files to find out how to use the lib. I did the following: #include <libnotify/notify.h> #include <iostream> int ...


10

The eigen3 header files go in a subdirectory /usr/include/eigen3 e.g. /usr/include/eigen3/Eigen/Array /usr/include/eigen3/Eigen/Cholesky /usr/include/eigen3/Eigen/CholmodSupport /usr/include/eigen3/Eigen/Core /usr/include/eigen3/Eigen/Dense /usr/include/eigen3/Eigen/Eigen so you will need to specify the additional include path on your compiler command line,...


Only top voted, non community-wiki answers of a minimum length are eligible