Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22118

Running 'gcc' on C++ source file on Linux gives "cc1plus: out of memory allocating ..." error message

$
0
0

I encountered a puzzling problem when compiling a C++ source file using 'gcc' on Ubuntu. Having solved the problem I would like to publish it here to save others the headache of solving it.

For the sake of this report we have the simplest possible C++ "Hello, World" program, stored in main.cpp:

#include <stdio.h>

int main (int argc, char *argv[])
{
    return 0;
}

When I run the command:

gcc main.cpp

I get the error message:

cc1plus: out of memory allocating 1677721600 bytes after a total of 475136 bytes

I verified I was compiling for the correct bittage (i.e., 32-bit). What was I doing wrong?


Viewing all articles
Browse latest Browse all 22118

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>