kriscross07 / atom-gpp-compiler

An atom package that allows you to compile and run C++ and C within the editor.
https://atom.io/packages/gpp-compiler
80 stars 229 forks source link

Uncaught Callback must be a function #308

Open andrrff opened 4 years ago

andrrff commented 4 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.44.0 x64 Electron: 4.2.7 OS: Unknown Windows version Thrown From: gpp-compiler package 3.0.7

Stack Trace

Uncaught Callback must be a function

At fs.js:129

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:129:9)
    at Object.writeFile (fs.js:1137:14)
    at ChildProcess.child.on (/packages/gpp-compiler/index.js:299:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)

Commands

  2x -0:19.9.0 gpp-compiler:compile (input.hidden-input)

Non-Core Packages

atom-clock 0.1.17 
atom-file-icons 0.7.1 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.3 
atom-python-run 0.9.7 
autocomplete-java 1.2.7 
autosave-onchange 1.5.1 
busy-signal 2.0.1 
file-icons 2.1.39 
git-plus 8.7.1 
gpp-compiler 3.0.7 
html-tab 1.0.2 
Hydrogen 2.14.0 
ide-html 0.6.0 
ide-java 0.9.0 
ide-python 1.5.0 
intentions 1.1.5 
kernel-docstring 1.1.0 
language-cuda 0.1.0 
linter 2.3.1 
linter-ui-default 1.8.1 
minimap 4.29.9 
monokai 0.24.0 
platformio-ide-terminal 2.10.0 
scroll-through-time 0.3.1 
seti-icons 1.5.4 
teletype 0.13.4 
tool-bar 1.2.1 
fitz1987 commented 4 years ago

I am having this same issue on Mac. was just trying to compile a hello world to test my install.

edd0y commented 4 years ago

I am having this same issue on Mac. was just trying to compile a hello world to test my install.

Me too. How to resolve?

fitz1987 commented 4 years ago

What I realized was that what was actually wrong (on Mac) was that some c++ header files were not visible to the compiler because they were in an odd location. So I copied them to where the compiler expected them to be and that was it.

ghost commented 4 years ago

I am having this same issue on Mac. was just trying to compile a hello world to test my install.

Me too. How to resolve?

Just add ".c" in the file name before saving it.

fitz1987 commented 4 years ago

That would not have solved my issue, since it was already saved as a c++ file. See solution above.

bignosejones commented 4 years ago

I'm still having this issue and the solution above is painfully vague, can someone please help?

fitz1987 commented 4 years ago

@bignosejones are you on Mac or windows

Schoolboygames commented 4 years ago

I'm a tech noob and getting this error. someone please help! I'm on linux mint and I installed gcc. I don't know what the issue is.

ananya112 commented 4 years ago

I got this error on windows and have no idea how to solve it. Any help would be appreciated!

fitz1987 commented 4 years ago

I can’t help with windows, sorry.

Windedhiker commented 4 years ago

I'm on a Mac, and I have the same issue.

fitz1987 commented 4 years ago

Do you get more than one error message, or just this one? In my case, the compiler was not seeing the header files and I just copied them to the location that it said in the error message.

RaveFX commented 4 years ago

I'm still having this issue and the solution above is painfully vague, can someone please help?

there was a unnecessary space and a comma in my printf section, which was automatically added by atom itself. i removed that space and the comma.Then everything went okay.

heylisten64 commented 4 years ago

I'm having trouble to compile C (.c) but C++(.cpp) is ok.

BrannVilla commented 4 years ago

Tengo este mismo problema en Mac. solo intentaba compilar un hello world para probar mi instalación.

Yo también. ¿Cómo resolverlo?

Simplemente agregue ".c" en el nombre del archivo antes de guardarlo.

Yo lo comprobé y me resulto funciona realmente.

RaveFX commented 4 years ago

I'm having trouble to compile C (.c) but C++(.cpp) is ok.

try reinstalling the gcc g++ compiler in the atom plugins . im using the "gpp-compiler" as the atom plugin.

kukkieman commented 4 years ago

I just downloaded the "gpp-compiler", set its PATH and executed a Hello, world! program, but it shows this exact error. I've tried re-installing the plug-in and even restarting my system but nothing seems to work!

RaveFX commented 4 years ago

I just downloaded the "gpp-compiler", set its PATH and executed a Hello, world! program, but it shows this exact error. I've tried re-installing the plug-in and even restarting my system but nothing seems to work!

are you sure about the MinGW? did you installed it correctly ?

Innovation1999 commented 4 years ago

Today, I found a way to fix that #319