Results 1 to 4 of 4

Thread: I need like 4GB for my program, how do I allocate 4GB?

  1. #1
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default I need like 4GB for my program, how do I allocate 4GB?

    TEMPLATE = app
    CONFIG += console
    CONFIG -= app_bundle
    CONFIG -= qt

    SOURCES += main.cpp

    QMAKE_LFLAGS += /LARGEADDRESSAWARE

    do i just have to put this in the .pro file of my project "main"?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: I need like 4GB for my program, how do I allocate 4GB?

    If you are running on a 32-bit Windows system then you will not be able to allocate 4GB either in a single block or in pieces: your process is limited to 3GB:
    http://msdn.microsoft.com/en-us/libr...#memory_limits

    If you are running a 64-bit Windows executable then you should not need to do anything special.

  3. #3
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default Re: I need like 4GB for my program, how do I allocate 4GB?

    i have a 64 bit operating system, but the program still crashes


    Added after 29 minutes:


    I am using QTCREATOR, btw.
    Last edited by bmn; 22nd February 2014 at 20:07.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: I need like 4GB for my program, how do I allocate 4GB?

    A 64-bit operating system is not the same as a 64-bit executable. A 32-bit executable on a 64-bit OS has the same limits as a 32-bit application on a 32-bit OS.

    Assuming you are actually running a 64-bit executable then it may be there is no contiguous block of 4GB to allocate, that you are using structures with 32-bit int size limits, that you doing something unrelated that crashes... My crystal ball is out for polishing. Perhaps you could share what your program is doing, where and how it "crashes"?

    This has nothing to do with QtCreator, which is just a fancy text editor that can run your code through a C++ compiler.
    Last edited by ChrisW67; 22nd February 2014 at 23:20.

Similar Threads

  1. Replies: 0
    Last Post: 20th August 2010, 13:45
  2. Replies: 1
    Last Post: 30th April 2010, 13:25
  3. running external console program by gui program
    By alireza.mixedreality in forum Qt Programming
    Replies: 4
    Last Post: 24th April 2010, 18:05
  4. Replies: 7
    Last Post: 19th January 2008, 15:29
  5. appbar: allocate screen space (dock and lock)
    By mito in forum Qt Programming
    Replies: 1
    Last Post: 20th April 2007, 18:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.