Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with string VS Code C++ #1678

Closed
tsalinger opened this issue Mar 13, 2018 · 5 comments
Closed

Problem with string VS Code C++ #1678

tsalinger opened this issue Mar 13, 2018 · 5 comments
Labels
more info needed The issue report is not actionable in its current state

Comments

@tsalinger
Copy link

This issue has been moved from Microsoft/vscode/
Author is @Craix.


  • VSCode Version: 1.20.1
  • OS Version: 6.3.9600 Windows 8.1
#include <iostream> 

using namespace std; 

int main()
{
    cout<<"Hello worlds"<<endl; // that works 

    string text = "Hi, worlds "; // here i have problem 

    cin.ignore();
    cin.get();
    return 0; 
}

Hello, it's first time when i try to use VS Code <normaly i use VS 2017>. Follow this tutorial "
https://code.visualstudio.com/docs/languages/cpp" i try to compile and debug my code but then i got error with "string variable". (i'm not sure about it, but programs works good without this and get error when i try add and use string variables).

Error code:
=thread-group-added,id="i1" GNU gdb (GDB) 7.6.1 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "mingw32". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. =cmd-param-changed,param="pagination",value="off" [New Thread 1040.0x1648] gdb: unknown target exception 0xc0000139 at 0x77d8d572 ERROR: During startup program exited with code 0xc0000139. The program 'C:\...\main.exe' has exited with code 0 (0x00000000).


@bobbrow
Copy link
Member

bobbrow commented Mar 13, 2018

I'm a little unclear as to what your error is. Do you see red underlines under the string variable? Are you unable to build? Are you unable to debug?
Can you share your tasks.json and/or launch.json files?

@bobbrow bobbrow added the more info needed The issue report is not actionable in its current state label Mar 13, 2018
@WardenGnaw
Copy link
Member

@Craix Are you using MinGW or Cygwin?

I found associated StackOverflow posts on that error code.

From those they say:

The error code 0xc0000139 appears when mis-configured, important files gone missing or damaged. so switching in to a totally different compiler has solved the problem.

Can you also share the version of the compiler and the version of gdb that you are using?

@Craix
Copy link

Craix commented Mar 14, 2018

I have some troubles when i try run this code i don't know what type of problems is it. (I think that was an error because of this message ERROR: During startup program exited with code 0xc0000139)
The program start compiling (i see terminal window for while) and them programs is breaking down. I don't get any errors or outputs only debug info. I get same debug info with and without #include .

task.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "g++", 
            "args": [
                "-g", "main.cpp", "-o", "main.exe",
            ],

            "group": { 
                "kind": "build",
                "isDefault": true
            },
        }
    ]
}

launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceRoot}/main.exe",
            "preLaunchTask": "Build",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "C:/mingw/bin/gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

VS CODE version 1.20.1
Shell 1.6.9

I'm using MinGW
gcc MinGW 6.3.0

GNU gdb 7.6.1

The error code 0xc0000139 appears when mis-configured, important files gone missing or damaged.
so switching in to a totally different compiler has solved the problem.

Maybe i will try this but which version of mingw should i use?

@Rednas83
Copy link

Rednas83 commented May 16, 2018

I also have the same problem over here. In vs strings are working properly and in vs code they crash on startup with code 0xc0000139 (btw with the function Delete there is also the same error) . An easy fix for this problem is to replace string text by char text[]. Did anyone in the meanwhile manage to get string/delete working in vs code?

@bobbrow bobbrow added this to Needs triage in 0.26.2 Milestone Aug 15, 2018
@michelleangela
Copy link
Contributor

Closing this issue as the last response is more than a year old.

Update to the latest version of the C/C++ extension and see if issue still persists. Please re-open the issue and reply with additional information that can help us investigate the issue.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests

6 participants