I have encounter this problem after compiling my project..

cc1plus: out of memory allocating 22703868 bytes after a total of 47382528 bytes
compiling customerentryclass.cpp (g++)
gmake[1]: *** [initMethod.o] Error 1
if i build it in another PC which is lower specs than mine it builds, but on my pc its not..

how to solve this problem?