atom-gpp-compiler icon indicating copy to clipboard operation
atom-gpp-compiler copied to clipboard

Uncaught Callback must be a function

Open Tejasvigupta opened this issue 4 years ago • 13 comments

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.45.0 x64 Electron: 4.2.7 OS: Microsoft Windows 10 Home Single Language 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 Socket.stream.socket.on (internal/child_process.js:381:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:606:12)

Commands

  2x -2:30.4.0 core:move-right (input.hidden-input)
     -2:24.2.0 intentions:highlight (input.hidden-input)
     -2:23.9.0 core:save (input.hidden-input)
  2x -2:10.6.0 core:backspace (input.hidden-input)
  6x -2:02.0 core:move-up (input.hidden-input)
  3x -2:00.1.0 core:move-left (input.hidden-input)
     -1:59.4.0 core:move-down (input.hidden-input)
     -1:58.6.0 editor:newline (input.hidden-input)
     -1:57.3.0 intentions:highlight (input.hidden-input)
     -1:56.9.0 core:save (input.hidden-input)
     -1:47.5.0 core:backspace (input.hidden-input)
     -1:45.8.0 intentions:highlight (input.hidden-input)
     -1:45.7.0 core:save (input.hidden-input)
     -1:39.9.0 gpp-compiler:compile (input.hidden-input)
  2x -1:32.9.0 core:backspace (input.hidden-input)
 19x -1:31.4.0 gpp-compiler:compile (input.hidden-input)

Non-Core Packages

atom-file-icons 0.7.1 
atom-html-preview 0.2.6 
autocomplete-csjs 0.0.1 
autocomplete-python 1.16.0 
busy-signal 2.0.1 
class-complete 6.2.2 
css-helper-snippets 0.3.0 
css-specificity 0.2.2 
css-spy 0.6.0 
es6-javascript 1.0.0 
gpp-compiler 3.0.7 
highlight-selected 0.17.0 
html-tag-auto-complete 0.1.1 
intentions 1.1.5 
linter 2.3.1 
linter-gcc 0.9.0 
linter-gcc2 0.8.8 
linter-ui-default 1.8.1 
minimap 4.29.9 
minimap-highlight-selected 4.6.1 
node-debugger 1.10.1 
nodemon-generator 1.0.2 
platformio-ide-terminal 2.10.0 
script 3.25.0 
server-script 0.1.3 
terminal-plus 0.14.5 
turbo-javascript 1.4.0 
vk-terminal 3.0.1 

Tejasvigupta avatar Apr 30 '20 07:04 Tejasvigupta

I've had this issue a few times, and there was something wrong with my g++ installation, I suggest you try compiling manually and see what happens.

Spodeian avatar May 01 '20 01:05 Spodeian

that must be because of wrong code which you are trying to compile .do check your code as well before compiling

dpsingh11 avatar May 02 '20 18:05 dpsingh11

#include <bits/stdc++.h> using namespace std; int main(){ int n,a; cin>>n; vector v; for (int i=0; i<n;i++){ cin>>a; v.push_back(a); } for (int i=0 ;i<n ;i++){ cout<<v[i]; } } this is a simple code and it was working fine on online compiler

Tejasvigupta avatar May 03 '20 19:05 Tejasvigupta

I've had this issue a few times, and there was something wrong with my g++ installation, I suggest you try compiling manually and see what happens.

Hi ,I tried compiling it on an online compiler and it worked fine there.

Tejasvigupta avatar May 03 '20 19:05 Tejasvigupta

I've had this issue a few times, and there was something wrong with my g++ installation, I suggest you try compiling manually and see what happens.

Are you familiar with some good packages for c++ ? Please suggest some because I have been running into one or other error.

Tejasvigupta avatar May 03 '20 19:05 Tejasvigupta

#include <bits/stdc++.h> using namespace std; int main(){ int n,a; cin>>n; vector v; for (int i=0; i<n;i++){ cin>>a; v.push_back(a); } for (int i=0 ;i<n ;i++){ cout<<v[i]; } } this is a simple code and it was working fine on online compiler

There are errors in here (and the formatting is bad).

#include <iostream>
#include <vector>

using namespace std;

int main() {
	int n, a;
	vector<int> v;

	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> a;
		v.push_back(a);
	}

	for (int i = 0; i < n; i++) {
		cout << v[i];
	}

	return 0;
}

Spodeian avatar May 07 '20 13:05 Spodeian

try that

Spodeian avatar May 07 '20 13:05 Spodeian

Also when I was having that error it was because of my float libraries being outdated in my g++ installation.

Spodeian avatar May 07 '20 13:05 Spodeian

Also when I was having that error it was because of my float libraries being outdated in my g++ installation.

#include using namespace std; int main(){ int a=5; auto b=a; cout<<b; } I am not able to compile even this code. Should I reinstall atom or what? p.s I am new to c++.

Tejasvigupta avatar May 11 '20 15:05 Tejasvigupta

The same problem me too

Double-Wen avatar May 15 '20 04:05 Double-Wen

Also when I was having that error it was because of my float libraries being outdated in my g++ installation.

#include using namespace std; int main(){ int a=5; auto b=a; cout<<b; } I am not able to compile even this code. Should I reinstall atom or what? p.s I am new to c++.

#include <iostream>
using namespace std;
int main(){
int a=5;
auto b=a;
cout<<b;
}

#include needs to actually have something to include, it can't be left empty, on top of that, cout doesn't work without iostream.

If you can't compile with this plugin on Atom, try to do it just using MSYS and g++.

The smallest code that would compile (that I can think of and has at least 1 non-return statement) is:

int main() {
  a = 0;
  return a;
}

However, my windows defender thought it was a virus. You could also do:

#define A 0
int main() {
  return A;
}

Spodeian avatar May 15 '20 21:05 Spodeian

Today, I found a way to fix that #319

Innovation1999 avatar May 16 '20 10:05 Innovation1999

Can someone explain to me why when I compile a code I get this error: The error was thrown from the gpp-compiler package. What does that mean ? What I do?

AleML24 avatar May 16 '20 18:05 AleML24