CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Confused about /bigobj

    I'm updating a program which previously got compiled with VC2005 (I'm compiling it now with VC2019). One of the source modules was fine with VS2005 but it gives me this compiler error with VS2019:-

    Code:
    fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj
    I'm also converting from a 32-bit build to 64-bit - so maybe that's the problem. Either way... how/where do I set /bigobj ? I've look in the Compiler Properties pages but I can't see anything obvious
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: Confused about /bigobj

    Properties/C++/CommandLine. Add it to Additional Options.

    Not all compiler options are in the properties pages - some (another is /J to make char default to unsigned rather than signed) have to be specifically set.

    PS
    For a list of all options, see https://docs.microsoft.com/en-us/cpp...?view=msvc-160
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  3. #3
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: Confused about /bigobj

    Thanks 2kaud, that seems to fix it. BTW... as it happens, the module I'm building is a DLL. At the moment, I've only specified /bigobj for that one source file. Should that be okay - or will I need to apply it to all the source files for that DLL?
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  4. #4
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: Confused about /bigobj

    The /bigobj applies to the number of sections in the generated .obj file. So /bigobj would usually be applied to the project properties - not an individual source property. However it shouldn't matter - as it will apply to the generated .obj for which the source file is used.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured