Thanks to visit codestin.com
Credit goes to github.com

Skip to content

make sure set flag in gyp file if use c++ exception on msvc #311

@annidy

Description

@annidy

The MSVC (cl.exe) don't support c++ exception by default, you should pass compile argument /EHsc

cl /EHsc main.cpp

if use gyp build script, modify like this

'configurations': {
  'Release': {
    'msvs_settings': {
      'VCCLCompilerTool': {
        'RuntimeLibrary': '0',
        'Optimization': '2',
        'EnableIntrinsicFunctions': 'true',
        'DebugInformationFormat': '3',
        'RuntimeTypeInfo': '/GR',
        'AdditionalOptions': ['/utf-8'],
        'ExceptionHandling': '1'  // 添加此行
      },
      'VCLinkerTool': {
        'GenerateDebugInformation': 'true',
        'GenerateMapFile': 'false'
      }
    }
  }
}

if not set, the app will killed by abort(), without core dump.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions