VisualGDB error: cc1plus.exe: out of memory allocating

Sysprogs forums Forums VisualGDB VisualGDB error: cc1plus.exe: out of memory allocating

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7548
    John24
    Participant

    Hello,

    I am having issues with cross compiling my code on the local machine and sending the binaries to raspberry pi to be run. My project includes multiple libraries which are being changed thus need to be recompiled.

    Now this issue only happens when i try to optimize the code.

    With : std=c++0x -ggdb -ffunction-sections -O0 -Wno-deprecated everything works perfectly fine,

    but with : -std=c++0x -ggdb -ffunction-sections -O3 -Wno-deprecated i get the “cc1plus.exe: out of memory allocating 1335264 bytes” error.

    Any idea what could be going wrong?

    Thank you

    • This topic was modified 8 years, 3 months ago by John24.
    #7550
    John24
    Participant

    I found that the issue was the compiler needing more than 2Gb of memory. Fixed it telling Visual Studio 2013 to be /LARGEADDRESSAWARE (Handle Large Addresses). This can be usually done in multiple ways but because of using VisualGDB you can’t change linker settings in the properties sheet.

    This can be done using the common prompt in windows.

    1. Open Common Prompt
    2. Go to visual studio binary folder “cd C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
    3. Run “editbin /LARGEADDRESSAWARE “C:\SysGCC\raspberry\libexec\gcc\arm-linux-gnueabihf\4.9\cc1plus.exe” command with the location of GCC compiler executable location.

    This should fix the problem.

    • This reply was modified 8 years, 3 months ago by John24.
    #7556
    support
    Keymaster

    Cool, thanks for sharing this.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.