Hot answers tagged

44

You should use #include <iostream>, not iostream.h; the .h form is very old and deprecated since years. You can read more than you probably want to know on the .h vs non-.h forms here: http://members.gamedev.net/sicrane/articles/iostream.html (Plus, you should write std::cout or have a line using namespace std; otherwise your next error will be about ...


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"....


34

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 ...


25

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 ...


23

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


23

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 ...


20

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


20

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


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/...


17

/usr/local/lib/ should be the right folder for this. It is the normal place for keeping shared library files installed manually from source code (as defined by FHS). If you build a library by running ./configure, make, and sudo make install, it will usually install there automatically.


16

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 ...


15

You should change iostream.h to iostream. I was also getting the same error as you are getting, but when I changed iostream.h to just iostream, it worked properly. Maybe it would work for you as well. In other words, change the line that says: #include <iostream.h> Make it say this instead: #include <iostream> The C++ standard library header ...


15

It is currently not possible to use Python with the Ubuntu SDK. The Ubuntu project is tightly focused on getting a stable mobile phone OS by October 2013, and a full convergent story by Ubuntu 14.04. In order to achieve this, QML has been the language of choice to recommend to app developers to write their software. Technically, provided that there are Qt/...


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

On Ubuntu versions after 10.10 you'll run into this in more related applications, such as QtCreator. It is a security feature of Ubuntu that prevent the debugger to attach to processes not owned by him. This is filed as a bug #3509 against QtCreator. To work around this issue, do this: temporary solution (won't survive a reboot): echo 0 | sudo tee /proc/...


14

Install the libgeos-dev package with your favourite package manager (or software centre) and you'll have /usr/bin/geos-config. How did I find this? I used the query geos-config for files on the http://packages.ubuntu.com/ webpage. This will list the package you need (query link). Use this next time when you run into similar issues!


13

This isn't something that QML supports, the typical answer is to write a C++ plugin to handle that kind of thing. However, the SDK team is planning out various extensions to provide to QML app developers, and this may be something that they implement in a generic plugin that you can use.


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


13

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 ...


13

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 ...


13

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?


12

Most likely you are simply missing a compiler. Get one by installing build-essential package. Typing sudo apt-get install build-essential into terminal is one of the easiest ways to achieve that.


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

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: ...


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