linter-gcc icon indicating copy to clipboard operation
linter-gcc copied to clipboard

Uncaught TypeError: Cannot read property 'binary' of undefined

Open ghost opened this issue 9 years ago • 42 comments

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.5.3 System: ALI-PC Thrown From: linter-gcc package, v0.6.5

Stack Trace

Uncaught TypeError: Cannot read property 'binary' of undefined

At C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\pane.js:825

TypeError: Cannot read property 'binary' of undefined
    at Object.lint (C:/Users/Ali/.atom/packages/linter-gcc/lib/main.js:61:32)
    at lintOnSave (C:/Users/Ali/.atom/packages/linter-gcc/lib/main.js:107:22)
    at Function.module.exports.Emitter.simpleDispatch (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:125:28)
    at TextBuffer.module.exports.TextBuffer.saveAs (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:1067:27)
    at TextBuffer.module.exports.TextBuffer.save (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:1037:19)
    at TextEditor.module.exports.TextEditor.save (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\text-editor.js:630:26)
    at Pane.module.exports.Pane.saveItem (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\pane.js:545:18)
    at Pane.module.exports.Pane.saveActiveItem (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\pane.js:528:19)
    at Workspace.module.exports.Workspace.saveActivePaneItem (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\workspace.js:649:35)
    at atom-workspace.commandRegistry.add.core:save (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\register-default-commands.js:173:32)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\command-registry.js:260:29)
    at C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:536:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:359:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\window-event-handler.js:97:36)
    at HTMLDocument.<anonymous> (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\window-event-handler.js:3:61)

Commands

     -9:54.9.0 core:save (div.package-detail.panels-item)
     -9:34.5.0 editor:newline (atom-text-editor.editor.is-focused)
     -9:31.1.0 core:save (atom-text-editor.editor.is-focused)
     -8:58.7.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -8:57.7.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "minimap"
    ],
    "themes": [
      "atom-dark-ui",
      "one-dark-syntax"
    ]
  },
  "linter-gcc": {
    "execPath": "MinGW/bin/gcc"
  }
}

Installed Packages

# User
atom-html-preview, v0.1.13
autoclose-html, v0.20.0
autocomplete-html-entities, v0.1.0
autocomplete-python, v1.6.1
color-picker, v2.1.1
linter, v1.11.3
linter-gcc, v0.6.5
terminal-plus, v0.14.5

# Dev
No dev packages

Can someone help me I installed Atom new and i dont know what i did wrong.

ghost avatar Feb 13 '16 08:02 ghost

Hey, i just installed platformIO atom IDE and just got the same problem, Would be happy if you would share solution if you found one :)

Skosulor avatar Feb 23 '16 21:02 Skosulor

The issue here was probably that gcc wasn't installed. Please read the wiki and follow the steps there.

hebaishi avatar Feb 23 '16 21:02 hebaishi

Hello. Is it working for you now?

hebaishi avatar Feb 24 '16 11:02 hebaishi

Im trying a reinstall right now, im on windows and having a few problems. My goal is first to compile and run c++ files and second is to get linter to work.

The wiki says something about gcc version 6.0, seems i have an much older version, 2.91.57. Does cygwin install the latest?

Im using the gpp-compiler package to compile my c++ files but i get an error that "start" could not be spawned and be added to path but i have no clue what "start" is, g++ is in the path and working, i get a compiled file.

Thanks for the help!

On Wed, Feb 24, 2016 at 12:34 PM, Husam Hebaishi [email protected] wrote:

Hello. Is it working for you now?

— Reply to this email directly or view it on GitHub https://github.com/hebaishi/linter-gcc/issues/29#issuecomment-188211180.

Skosulor avatar Feb 24 '16 11:02 Skosulor

You mis-read the wiki. The wiki says that versions 0.6.0 -> 0.6.5 of linter-gcc are missing a feature (the automatic installation of the base linter package), but I assume you have installed the latest version of linter-gcc which means you shouldn't have this problem. What you need to do is setup g++ on cygwin so that g++ is in your $PATH so that the command g++ --version works in the terminal.

hebaishi avatar Feb 24 '16 11:02 hebaishi

Please see this guide on how to install gcc/g++ on Cygwin.

hebaishi avatar Feb 24 '16 11:02 hebaishi

I've gotten that to work, g++ is in the path and i can use g++ in cmd

Skosulor avatar Feb 24 '16 11:02 Skosulor

Ok. Now all your need to do is specify g++ as your executable path in the linter-gcc configuration settings and it should just work.

hebaishi avatar Feb 24 '16 11:02 hebaishi

Do i do that in the config.js file for linter-gcc? I Couldn't find anything about specifying path in the settings.

Skosulor avatar Feb 24 '16 12:02 Skosulor

No. In atom, you click Packages > Settings View > Open. Then click Packages on the left hand panel, and type linter-gcc into the filter box. Click Settings it to get to the configuration settings.

hebaishi avatar Feb 24 '16 12:02 hebaishi

It seems you are unfamiliar with atom. I suggest you read the Atom Flight Manual here to get more familiar with the interface.

hebaishi avatar Feb 24 '16 12:02 hebaishi

Yes, i first found out about it a few days ago, thanks alot! :+1:

Skosulor avatar Feb 24 '16 12:02 Skosulor

Is linter-gcc working for you?

hebaishi avatar Feb 24 '16 12:02 hebaishi

No i get the error,

"linter-gcc: Executable not found" "C:\MinGW\bin" not found

and

Uncaught TypeError: Cannot read property 'binary' of undefined /C:/Users/Andreas/.atom/packages/linter-gcc/lib/main.js:72

Skosulor avatar Feb 24 '16 12:02 Skosulor

The binary you have entered is still incorrect. You need to enter g++ into the linter-gcc configuration settings page (in the GCC Executable Path), NOT C:\MinGW\bin. The full path (I'm assuming it's C:\MinGW\bin\g++) will not work because g++ needs to know where to find its header files. It has to be in your path for this whole thing to work.

hebaishi avatar Feb 24 '16 12:02 hebaishi

Ah thank you, now i no longer get the error! But seems i forgot to install clang... Thanks alot for helping me and explaining in a way i understand :)

Skosulor avatar Feb 24 '16 13:02 Skosulor

Clang is a different compiler from g++. Does linting C/C++ code work for you now?

hebaishi avatar Feb 24 '16 13:02 hebaishi

Yeah it works now!

Skosulor avatar Feb 24 '16 13:02 Skosulor

@hebaishi Hello, I tried: C:\MinGW\bin\g++, but it still not work.

quantumlaser avatar Mar 19 '16 17:03 quantumlaser

I'm also having this problem. I tried C:\MinGW\bin\g++.exe and the error goes away but it doesn't do any "Lint"ing

jordanlhunt avatar Mar 22 '16 23:03 jordanlhunt

thanks for the guidence! I’ve fixed it.

heyxiaosong avatar Apr 03 '16 15:04 heyxiaosong

Sometimes this error occurs when storing/using/writing the same project from different OS-platforms to the same folder (e.g. on cloud ...)

Uncaught TypeError: Cannot read property 'binary' of undefined

At /usr/share/atom/resources/app.asar/src/pane.js:1002

TypeError: Cannot read property 'binary' of undefined

If this is your issue, you need to re-init your project from the 'platformio' menu.

HanKooR avatar May 12 '16 13:05 HanKooR

Sir, can you make a tutorial out to fix this error & post it in youtube ?

florist-notes avatar Jun 28 '16 06:06 florist-notes

To whom was this replay/question directed?

HanKooR avatar Jun 28 '16 08:06 HanKooR

To me, I believe. I'm writing a guide for windows users now.

hebaishi avatar Jun 28 '16 08:06 hebaishi

Anyone who is willing to help.A tutorial from installing ,integrating gcc & compiling+running a c++ program will be very helpful.

florist-notes avatar Jun 28 '16 08:06 florist-notes

Sir, I am stuck up here - https://www.quora.com/How-do-I-integrate-GCC-with-Atom-to-compile-C++-code

Also I went to package>settings & under GCC path - gave g++ but nuthing works.Help from here is welcome.I am a beginner, so I might have made mistakes.please look in the description of quora.

florist-notes avatar Jun 28 '16 08:06 florist-notes

You have done the right thing and added g++ to your PATH. You just need to set your linter-gcc executable path to g++.exe and it should work.

hebaishi avatar Jun 28 '16 08:06 hebaishi

capture1 capture2

Sir, I dont understand.What does the error means ?

florist-notes avatar Jun 28 '16 08:06 florist-notes

You are using the wrong header files. conio.h is a C header, and in C++ to use cin and cout, you #include <iostream>. Your code looks like C++ code, so delete the conio include, and change the iostream include to #include <iostream>.

Please read this article on header files.

hebaishi avatar Jun 28 '16 08:06 hebaishi