vs运行c代码的代码

时间:2017-08-09 10:33:04

标签: json visual-studio-code

我有一个使用makefile构建的现有代码库,我想使用Visual Studio Code来运行它。 有我的launch.json和tasks.json。

{
"version": "0.2.0",
"configurations": [{
    "name": "C Launch (GDB)", 
    "type": "cppdbg", 
    "request": "launch",
    "launchOptionType": "Local", 
    "targetArchitecture": "x64",         
    "cwd": "${workspaceRoot}", 
    "program": "E:/code/c", 
    "miDebuggerPath": "E:/Program Files/TDM-GCC-64/bin/gdb64.exe", 
    "args": [""],
    "stopAtEntry": false, 
    "externalConsole": true, 
    "preLaunchTask": "gcc"   
}]
}   


{
"version": "0.1.0",
"command": "gcc", 
"args": ["${file}", "-o", "${fileBasenameNoExtension}.exe", "-g3", "-Og", "-Wall", "-static-libgcc", "-std=c11", "-fexec-charset=GBK", "-finput-charset=UTF-8"],  
"showOutput": "always",
"problemMatcher": {
    "owner": "c",
    "fileLocation": ["relative", "${workspaceRoot}"],
    "pattern": {
        "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
        "file": 1,
        "line": 2,
        "column": 3,
        "severity": 4,
        "message": 5
    } 
}
}

然后当我运行Hello world时,会遇到一些问题。

enter image description here

1 个答案:

答案 0 :(得分:1)

尝试在Windows上更改路径以使用data = [] # array with all data with open('data/data.csv', 'r') as csvfile: #Read csv file readCSV = csv.reader(csvfile, delimiter=',') #Loop each line/row for row in readCSV: # Convert string to datetime fulldate = datetime.strptime(row[1], '%Y-%m-%d %H:%M:%S') name = row[0] year = fulldate.year month = fulldate.month day = fulldate.day hour = fulldate.hour minute = fulldate.minute data.append([year, month, day, hour, minute]) model = TSNE(n_components=3, perplexity=20, early_exaggeration=4.0, learning_rate=10000, n_iter=1000, n_iter_without_progress=50, min_grad_norm=0, init='pca', method='exact', verbose=2) np.set_printoptions(suppress=True) tsne_array = model.fit_transform(data) fig = pyplot.figure() ax = Axes3D(fig) for element in tsne_array: ax.scatter(element[0], element[1],element[2], color="r") pyplot.show() 而不是\。由于必须在json字符串中转义/,因此实际值为:

\

如果构建的可执行文件实际上位于"program": "E:\\code\\c\\${fileBasenameNoExtension}.exe"