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 228 forks source link

Uncaught TypeError: Callback must be a function. Received undefined #376

Open kevingjoni opened 3 years ago

kevingjoni commented 3 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.54.0 x64 Electron: 6.1.12 OS: macOS 11.2 Thrown From: gpp-compiler package 3.0.7

Stack Trace

Uncaught TypeError: Callback must be a function. Received undefined

At fs.js:142

TypeError [ERR_INVALID_CALLBACK] [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at maybeCallback (fs.js:142:9)
    at Object.writeFile (fs.js:1175:14)
    at /packages/gpp-compiler/index.js:299:12)
    at ChildProcess.emit (events.js:200:13)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:200:13)
    at Pipe.<anonymous> (net.js:586:12)

Commands

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

Non-Core Packages

gpp-compiler 3.0.7 
ide-c-cpp 0.1.0 
Viraj-M commented 3 years ago

Yeah guys help this guy and me IT SO IRITATING

TheLuke02 commented 3 years ago

I have the same issue

Harumaru75 commented 3 years ago

Yes, having the same issue. Can someone walk me through the process of changing PATH to include the gpp compiler? I think that's where my issue lies.

SAYAN444-CHAOS commented 3 years ago

yes i have also face the same problem

Viraj-M commented 3 years ago

Bruh why is no one commenting anything about this?

Viraj-M commented 3 years ago

like the solution or anything

0pk0 commented 3 years ago

anyone who fixed this ?

SarahX commented 3 years ago

I also have the same problem

Viraj-M commented 3 years ago

BRUH i tried changing my path niothing

Viraj-M commented 3 years ago

i now started using visual studio code if u cant solve this problem try switching over to visual studio code like the themes are also available and extensions are the same so yeah

Viraj-M commented 3 years ago

oh yeah and c programs were running but not in atom

Harumaru75 commented 3 years ago

Visual Studio is WAAAAAAAAY better.

From: @.> Sent: Tuesday, March 16, 2021 2:23 AM To: @.> Cc: @.>; @.> Subject: Re: [kriscross07/atom-gpp-compiler] Uncaught TypeError: Callback must be a function. Received undefined (#376)

i now started using visual studio code if u cant solve this problem try switching over to visual studio code like the themes are also available and extensions are the same so yeah

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkriscross07%2Fatom-gpp-compiler%2Fissues%2F376%23issuecomment-800094989&data=04%7C01%7C%7Cdc0a620ba13948ffd14c08d8e85d1e08%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637514833915453320%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=MUbXm3lDApPy5SSn%2BgX5zI7b3x2Ve4iyZcNaJZi8fwY%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATGCAXP2T7VVCLLUID2V5HLTD4PP3ANCNFSM4YRQHCBQ&data=04%7C01%7C%7Cdc0a620ba13948ffd14c08d8e85d1e08%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637514833915463314%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=nnIHW7dSopW%2BQGeJA5JVXOCC0SMqudq80gq9gANqZNw%3D&reserved=0.

JunK4i commented 3 years ago

My problem was solved when I stopped my existing running program. Make sure u close all other terminals.

Viraj-M commented 3 years ago

nope dosent work for me JunK4i

beniodaisuke commented 3 years ago

初めまして C++を勉強中のものです。同じエラーが出てコンパイルできません。因みに インストールしたpackagesは、atom-beautify linter-gcc japanese-menu gpp-compilerです。解決方法や設定方法など教えて頂きたいです。

akramex-dz commented 3 years ago

Any concreat solution?

SarahX commented 3 years ago

有没有人有办法解决吗 即使您更改PATH,仍然无法正常工作

SasidharanGS commented 3 years ago

Please refer this thread for instructions on linking the math library: https://github.com/kriscross07/atom-gpp-compiler/issues/100

Fitap commented 3 years ago

Please refer this thread for instructions on linking the math library:

100

Thanks a lot. I have same issue and this solved for me.

RakibOFC commented 3 years ago

I have solved my problem. Open Linux terminal (Ctrl+Alt+T) and enter: sudo apt install gcc g++ (Y/n): Y

Full description:

Linux

The GNU Compiler Collection may come with your distribution. Run which gcc g++ to find out.

If that command does not output

/usr/bin/gcc /usr/bin/g++ you will need to install it.

For RHEL-based distros, run sudo dnf install gcc gcc-c++

For Debian-based distros, run sudo apt install gcc g++

For Arch-based distros, run sudo pacman -S gcc

Supragy352 commented 3 years ago

Ok so I've got a solution. Basically, the C and C++ compilers are different (obviously), and so far only 3 types of reasons might be causing this error. Try and follow the steps and I hope the thing starts working.

  1. Check your system path for errors. It is suposed to have "C:\Program Files\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin".
  2. The function Atom is trying to call does not exist in the compiler you are invoking, So. make sure that in the package settings, the C compiler is set to "gcc" and the C++ compiler is set to "g++".
  3. Try reinstalling MingW compiler.
mrityunjai01 commented 2 years ago

Settings > Packages > View Code under gpp compiler

In the file index.js line 299 changed to

fs.writeFile(path.join(info.dir, "compiling_error.txt"), (err) => {});

line 427 changed to

fs.unlink(path.join(info.dir, "compiling_error.txt"), (err) => {});

Then disabling and re-enabling the package from settings solved the issue.