Hot answers tagged

3

You can install GCC 6 by adding the ubuntu-toolchain-r/test PPA. To do so, run the following commands: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install gcc-6 You can verify that gcc-6 is installed by running gcc-6 --version and the output should say gcc-6 (Ubuntu 6.1.1-2ubuntu12~16.04) 6.1.1 20160510. As suggested by ...


3

Your question What gcc -o sample sample.c actually does The command you have pasted triggers gcc to compile sample.c. As a result you'll get an output/executable with the same sample. The parameters (as -o in your example which defined the name of the output file ) are explained in the man page of gcc. You can open it by running man gcc I am quoting the ...


2

How about adding more swap to your machine as a solution? This will add more virtual memory and may allow you to build your code without the OOM killer killing the compiler. If you don't want to fiddle around with making your swap partition larger your could add a temporary swap file. For example, adding a file based 4GB swap: dd if=/dev/zero of=swap.img ...


2

Core dumping is disabled by default in Ubuntu by setting the maximum dumping file size to 0 for all users. You can check this by: ulimit -c By default it would show 0. Now to enable core dumping, set the size to the value you want (or unlimited). For example, setting the maximum dumping file size as 4 KB: ulimit -c 8 -c takes block numbers with each ...


2

Section 6.39 Dollar Signs in Identifier Names of the GCC manual states: In GNU C, you may normally use dollar signs in identifier names. This is because many traditional C implementations allow such identifiers. However, dollar signs in identifiers are not supported on a few target machines, typically because the target assembler does not allow them.


1

Perhaps the most 'Ubuntu' way of seeing the source code for rsync, as well as seeing the Debian packaging and patching material, is to activate the sources by following (under Xenial): Dash > Software & Updates > Ubuntu Software > Source Code Ticking the 'Source Code' box and allowing the repositories to reload. Then run the following single ...


1

You'll want to add a -Idir flag to your CXX flags in the make file and likely the cmake file. The dir would be the path to the headers you do want to use. If just including the proper directories doesn't work then it would be best to also disable the default include paths with --nostdinc but this shouldn't be needed since it searches the include directories ...


1

GCC is GNU C (language) compiler. It's used to "convert" programs written in C programming language into binary executable on computer. The syntax gcc -o sample sample.c means: Compile the file sample.c and name the output sample. Then you can launch your compiled program with <path_to_file>/sample, or from within the directory ./sample The default ...


1

The package installation of other architecture compilers puts them into a system area. The executables are uniquely named, but the package is too "helpful" and thinks you really need a short name link (like gcc) to point to them, and whoa, another package already uses that link, gotta delete it for you. This might be fine in a virtual machine, dedicated to ...


1

As we can see from your diagnostic output, gcc uses the external program as (which is /usr/bin/as) - the GNU assembler - and it is this that is failing. Somehow, it appears that the as binary executable has been corrupted on your system, to the point where even /usr/bin/as --version causes a bus error. (Although apparently it is intact enough for the file ...


1

If you want to build it from source (which I recommend as you can for example make a cross-compiler, etc.) download the source from a mirror. Then extract it with: tar -xvf gcc-6.1.0.tar.gz After that change directory to there: cd gcc-6.1.0 Then create build directory and cd to it: mkdir build cd build Then configure the makefile: ../configure --...



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