Eclipse fatal error no input files

Eclipse fatal error no input files I just downloaded c/c++ IDE developer and made a C++ project. but then under problems tab, these come up and I cannot proceed to do anything else from there. Program «g++» not found in PATH Program «gcc» not found in PATH sh-c «autoreconf-i» fyi, I had a EE […]

Содержание

  1. Eclipse fatal error no input files
  2. Eclipse fatal error no input files
  3. Breadcrumbs
  4. Eclipse fatal error no input files
  5. Breadcrumbs

Eclipse fatal error no input files

I just downloaded c/c++ IDE developer and made a C++ project. but then under problems tab, these come up and I cannot proceed to do anything else from there.

Program «g++» not found in PATH
Program «gcc» not found in PATH
sh-c «autoreconf-i»

fyi, I had a EE java developer installed previously, but when I downloaded c/c++ developer, I just clicked to replace all java’s with c/c++.

thanks for the help fellas

A compiler is a program that takes text files and turns them into binary object files.
A linker is a program than takes these binary object files and turns them into a neatly packaged library or an executable.
Often, the term «compiler» is taken to mean «compiler and linker», and they usually come as a pair.

An IDE is a set of nice tools that help you write the text files and use the compiler and linker. Eclipse is an IDE. SOmetimes an IDE comes with a compiler/linker. Sometimes it does not.

Go back to where you got Eclipse and check if it actually comes with the compiler. Perhaps there is a download with compiler, and a download without. You may have taken the one without.

Failing that, google for a C++ compiler for your chosen OS and see what you find. On linux, gcc (and its g++ guise) is common.

could you please check for me? I have no idea what indicates that there is a compiler included.
Here is the link:
http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/junor

^^ I clicked details on the eclipse that I installed. It’s called Eclipse IDE for C/C++ Developers

Look for the text «Eclipse IDE for C/C++ Developers does not contain a compiler or debugger». Looks like you have to provide it yourself.

Alright, I downloaded the MinGW. While installing, I clicked download latest repository catalogues, accepted the agreement, and when it asked me to choose which optional components of MinGW to install, I clicked c++ compiler, at the bottom though there are like msys basic system and mingw developer toolkit, which I did not click. After I installed it, I went to computer properties then environment variables and then added ;C:MinGWbin to Path. I then searched for cmd and typed in gcc. It outputted, gcc : no input files and in the next line said compilation terminated. I clicked eclipse and clicked C++ project. But still there was no MinGW GCC under Toolchains. All I saw was GNU autotools Toolchain.

Moschops, I appreciate you helping me but could you specify more as to what I should do step by step to get the eclipse to function properly? so that you won’t have to come back here and reply to every single problem that I encounter? that will be more beneficial to both of us. thanks in advance.

Short answer — no idea. I’ve never used Eclipse. I tried it once and I didn’t like it. I write my code in text files and manually compile them without an IDE.

Since it said gcc : no input files gcc clearly has been installed. All I can suggset now is that buried somewhere in Eclipse’s menus is an options to specify the compiler/location.

oh actually, I tried gcc again in cmd and this popped up, «gcc : fatal error : no input files» and below that is «compilation terminated.»

Here is one way gcc works; you type «gcc» and then you type the name of the file you want it to compile.

If you don’t provide the name of a file to compile, or any instructions, how does it know what you want it to do?

where do I provide that?

now I only get this error. sh-c «autoreconf-i»

can nobody fix this? this is problem something new??

I think you’re the first person I’ve met who uses Eclipse for C++. Now I know why 🙂

Источник

Eclipse fatal error no input files

Community

Participate

Eclipse IDE

Home » Language IDEs » C / C++ IDE (CDT) » g++.exe: no input files on mingw

g++.exe: no input files on mingw [message #159910] Mon, 05 December 2005 15:18
Mikael Hakman
Messages: 9
Registered: July 2009
I’m following Creating a simple Managed C++ Project — «Hello World» on a
Windows Platform and Building a simple C++ Project — «Hello World» on a
Windows Platform. I get the following build output:

make -k clean all
rm -rf ./hello.o ./hello.d HELLO.exe

Building file: ../hello.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -ohello.o ../hello.cpp
g++.exe: no input files
make: *** [hello.o] Error 1
make: Target `all’ not remade because of errors.
Build complete for project HELLO

What can be wrong?

Re: g++.exe: no input files on mingw [message #161048 is a reply to message #159910] Sun, 25 December 2005 23:37
Originally posted by: mbaudier.laposte.net

I ran into the same issue (unable to use MinGW with CDT because of the error
g++.exe: no input files).

Actually it seems to be an issue with make in MinGW (and not with CDT
itself, since the issue can be reproduced from the command line, using
make).
make tries to use ‘sh’ in order to run the g++ command. (seen using the -d
option, which generates a debug output)

By adding the argument —win32, it was possible to compile:

‘Building file: ../JNIAdapter.cpp’
‘Invoking: GCC C++ Compiler’
g++ -D_REENTRANT -D_GNU_SOURCE -D__int64=»long
long» -I»C:jdk1.5.0_05include» -I»C:jdk1.5.0_05includewin32″ -O3 -Wall
-c -fmessage-length=0 -mno-cygwin -oJNIAdapter.o ../JNIAdapter.cpp
‘Finished building: ../JNIAdapter.cpp’
‘ ‘

But when make tries to link, it runs again into the same kind of error:

‘Building target: ../../PrenzlJ/dll/prenzl.dll’
‘Invoking: GCC C++ Linker’
g++ -mno-cygwin -Wl,—add-stdcall-alias -shared -o../../PrenzlJ/dll/prenzl.dll
../JNIAdapter.o
g++.exe: no input files

Running
‘g++ -mno-cygwin -Wl,—add-stdcall-alias -shared -o../../PrenzlJ/dll/prenzl.dll
../JNIAdapter.o’ from the command line in the same directory actually works.
And that what make seems to do (as can be seen using -d option)

Hope it helps (a little bit), and I would also be grateful for help for the
next step!
I would also be happy to find a MinGW newsgroup. I could not find any. If
anybody knows one.

«Mikael Hakman» a

Re: g++.exe: no input files on mingw [message #161591 is a reply to message #161525] Tue, 10 January 2006 21:49
Originally posted by: mbaudier.laposte.net

it worked! Thanks a lot!

I used the following install files:
binutils-2.15.91-20040904-1.tar.gz
gcc-core-3.4.2-20040916-1.tar.gz
gcc-g++-3.4.2-20040916-1.tar.gz
gcc-objc-3.4.2-20040916-1.tar.gz
gdb-5.2.1-1.exe
mingw-runtime-3.9.tar.gz
mingw-utils-0.3.tar.gz
mingw32-make-3.80.0-3.exe
w32api-3.5.tar.gz

but not:
MSYS-1.0.10.exe
(as recommanded)

Источник

Eclipse fatal error no input files

Community

Participate

Eclipse IDE

Breadcrumbs

Home » Language IDEs » C / C++ IDE (CDT) » preparing eclipse for c/c++ development (Installed MinGW is not available on eclipse)

preparing eclipse for c/c++ development [message #1804548] Thu, 28 March 2019 15:51
Jonh Lee
Messages: 7
Registered: March 2019
Please help (just started building eclipse CDT for C/C++ development 2019-03-28)
Installed MinGW is not available on eclipse.

Installed packages: eclipse-cpp-2019-03-R-win32-x86_64, JavaSetup8u201, and mingw-w64-install on Windows 10 Home 64 system (newly purchased from HP model Omen 15.6″ laptop)

New path, ;C:MinGWmingw32bin (C:MinGW is chosen during MinGW installation) has been added to environment variable path. Eclipse launched properly. However, MinGW is not available on eclipse.

John 2019-03-28T11:45-04:00 Thursday

Re: preparing eclipse for c/c++ development [message #1804711 is a reply to message #1804636] Sat, 30 March 2019 03:46
Jonh Lee
Messages: 7
Registered: March 2019
First, thanks for your response. I have set the directory as C:Mingw before installation. During installation, mingw-w64-install created mingw32 under this directory and install all directories under this mingw32.

It is when I find the WinGW is not available, I then checked and found that MinGW installer put all directories, including bin, under directory mingw32, which is under C:MinGW, i. e. C:MinGWmingw32.

As I remembered, all directories suppose to be under C:MinGW directory along with mingw32 as one of directories. I have also tried to copy all directories back to C:MinGW, knowing it is not right way. But it is still not working as expected.

Is it possible due to HP laptop Omen, HP Window 10 Home 64, operating system?

Re: preparing eclipse for c/c++ development [message #1804724 is a reply to message #1804711] Sat, 30 March 2019 13:42
Jonh Lee
Messages: 7
Registered: March 2019
I have also tested «gcc» from Command Prompt, and found copy directories over is invalid.

Microsoft Windows [Version 10.0.17763.379]
(c) 2018 Microsoft Corporation. All rights reserved.

C:Usersjohnt>gcc
gcc: fatal error: no input files
compilation terminated.

C:Usersjohnt>C:MinGWmingw32bingcc
gcc: fatal error: no input files
compilation terminated.

C:Usersjohnt>C:MinGWbingcc
The system cannot find the path specified.

Re: preparing eclipse for c/c++ development [message #1804738 is a reply to message #1804727] Sat, 30 March 2019 20:24
Jonh Lee
Messages: 7
Registered: March 2019
I have tried both and no difference.

My understanding is that MinGW installer added new path, C:MinGWmingw32bin automatically, during the installation. However, eclipse environmental setting for MinGW is to look over «gcc» under the directory C:MinGWbin, therefore, it finds none.

Is there any way that eclipse can be setup such that it could able to look over gcc at C:MinGWmingw32bin instead of C:MinGWbin?

Re: preparing eclipse for c/c++ development [message #1804755 is a reply to message #1804738] Sun, 31 March 2019 14:14
Jonh Lee
Messages: 7
Registered: March 2019
This is what I have found from eclipse ccosole window preference C/C++ — Core Build Toolchains:

Core Build Toolchains: available Toolchains for GCC win32-i686 C:MinGWmingw32bingcc.exe, and the other is C:MinGWmingw32bini686-w64-mingw32-gcc.exe.

Based on eclipse’s available Toolchains for GCC, I believe that I have not get MinGW source properly.
Or, this new eclipse 2019-03 has different settings on the Toolchains.

I have tried to download previous version but eclipse site would not allow me to download previous release, eclipse Photon, nor Eclipse IDE 2018-12, after submitted donation again.

Re: preparing eclipse for c/c++ development [message #1804757 is a reply to message #1804755] Sun, 31 March 2019 15:50
Jonh Lee
Messages: 7
Registered: March 2019
Found problem! MinGW installed but not setup to use. After running mingw-get-setup for basic package, MinGW GCC has been shown for choosing.

I started to build Hello World as first project test1 but failed with following message displayed on console. Please tell me how to fix this issue.

11:32:33 **** Incremental Build of configuration Debug for project test1 ****
make all
Cannot run program «make»: Launching failed

Error: Program «make» not found in PATH
PATH=[C:/Program Files/Java/jre1.8.0_202/bin/server;C:/Program Files/Java/jre1.8.0_202/bin;C:/Program Files/Java/jre1.8.0_202/lib/amd64;C:Program Files (x86)Common FilesOracleJavajavapath;C:windowssystem32;C:windows;C:windowsSystem32Wbem;C:windowsSystem32WindowsPowerShellv1.0;C:windowsSystem32OpenSSH;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program FilesIntelWiFibin;C:Program FilesCommon FilesIntelWirelessCommon;C:MinGWmingw32bin;C:MinGWbin;C:UsersjohntAppDataLocalMicrosoftWindowsApps;C:MinGWmingw32bin;C:MinGWbin;;C:eclipse]

11:32:33 Build Failed. 1 errors, 0 warnings. (took 55ms)

Re: preparing eclipse for c/c++ development [message #1804877 is a reply to message #1804762] Tue, 02 April 2019 15:58
Jonh Lee
Messages: 7
Registered: March 2019
First, I have found an old package, eclipse Kepler, from my old laptop downloaded few years ago. I tried installed onto the new HP Omen laptop. I found that this old version is working with no additional effort needed.

Then, I see your reply and checked my laptop Omen. I have found the installed MSYS packages, is configured just for «Basic Setup»group that does not include the following MSYS packages, msys-autoconf, msys-automake, msys-binutils, msys-gcc, msys-gettext, msys-libiconv, msys-libtool.

I have installed above missing packages. However, new newly downloaded eclipse 2019-03 is still shown that «make» could not be found, therefore, build failed.

Because eclipse Kepler is running without problem. Is it possible that the new package, eclipse-cpp-2019-03-R-win32-x86_64, missing something?

Источник

Adblock
detector

Whenever I try to build C++ programs that involve I/O, I get errors in Eclipse.

02:19:02 **** Incremental Build of configuration Debug for project SecondProject ****
make all 
Building target: SecondProject
Invoking: GCC C++ Linker
g++  -o "SecondProject"   
g++: fatal error: no input files
makefile:45: recipe for target 'SecondProject' failed
compilation terminated.
make: *** [SecondProject] Error 1

It compiles just fine for other C++ programs that don’t require user input.

However, I can compile just fine when I use the command line without an issue. Why is this happening? Is there a fix for it?

asked Nov 29, 2016 at 7:23

Kashif's user avatar

1

The compiler is attempting to compile SecondProject with no source files. Which is why you observed this:

g++  -o "SecondProject"   
g++: fatal error: no input files

Troubleshoot

Verify your project properties in

Properties > C/C++ General > Paths and Symbols

Check that your Source Location and Include paths are setup correctly. If your paths are correct, you should see something like when you build again:

g++  -o "SecondProject"   ./<your src folder>/<something>.o ...

Otherwise, create a fresh new C/C++ Project and add the sources again.

answered Nov 29, 2016 at 7:34

Andrea Chua's user avatar

Andrea ChuaAndrea Chua

3022 silver badges8 bronze badges

3

leWire

1 / 1 / 2

Регистрация: 02.03.2014

Сообщений: 34

1

06.05.2015, 00:19. Показов 14743. Ответов 11

Метки нет (Все метки)


Не могу разобраться как исправить ошибки. Подсобите кто как может. Скриншот прилагается.

Сам код:

C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdio.h>
#define INDENT_WIDTH (4)
int main(void) {
    FILE * f;
    f = fopen("bad.txt", "r");
    int c, i, indents = 0;
        
    while ( ( c = getchar() ) != EOF ) {
    
        switch(c) {
            case 'n' :
                putchar('n');
                for ( i = 0; i < indents * INDENT_WIDTH; ++i )
                    putchar(' ');
                break;
            case '{' :
                indents += 1;
                putchar('{');
                break;
            case '}' :
                indents -= 1;
                if ( indents < 0 ) {
                    fprintf(stderr, "Syntax error!n");
                    return 1;
                }
                for ( i = 0; i < INDENT_WIDTH; ++i )
                    putchar('b');
                putchar('}');
                break;
            default :
                putchar(c);
        }
    }
    if ( indents ) {
        fprintf(stderr, "Syntax error!n");
        return 1;
    }
 
    return 0;
}

Миниатюры

Ошибки при компиляции "no input files"
 

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



Max Dark

шКодер самоучка

2173 / 1880 / 912

Регистрация: 09.10.2013

Сообщений: 4,135

Записей в блоге: 7

06.05.2015, 00:26

2

у вас терминал запущен в домашней директории(/home/lolka/)
перейдите в каталог с вашим файлом либо укажите полный путь до исходника

Bash
1
cd path/to/dir/



0



Эксперт PHP

4839 / 3852 / 1598

Регистрация: 24.04.2014

Сообщений: 11,300

06.05.2015, 00:28

3

leWire, для начала нужно убедиться, что в текущей директории есть файл tex.c



0



1 / 1 / 2

Регистрация: 02.03.2014

Сообщений: 34

06.05.2015, 00:44

 [ТС]

4

Файлы лежат в /home/lolka.

Добавлено через 1 минуту
«/home/lolka/bad.txt» — так правильно?



0



Эксперт PHP

4839 / 3852 / 1598

Регистрация: 24.04.2014

Сообщений: 11,300

06.05.2015, 10:53

5

Цитата
Сообщение от leWire
Посмотреть сообщение

«/home/lolka/bad.txt» — так правильно?

tex.c для начала найти нужно



0



1 / 1 / 2

Регистрация: 02.03.2014

Сообщений: 34

06.05.2015, 21:37

 [ТС]

6

tex.c находится ведь там где надо? разве нет?



0



Эксперт PHP

4839 / 3852 / 1598

Регистрация: 24.04.2014

Сообщений: 11,300

07.05.2015, 10:11

7

Цитата
Сообщение от leWire
Посмотреть сообщение

tex.c находится ведь там где надо? разве нет?

компилятор говорт что не видит его.



0



43 / 43 / 12

Регистрация: 06.10.2014

Сообщений: 135

07.05.2015, 11:13

8

Цитата
Сообщение от leWire
Посмотреть сообщение

tex.c находится ведь там где надо? разве нет?

Вы действительно думаете, что отсюда виднее, где этот файл у вас там находится?
Выполните команду ls или dir и увидите, что там у вас есть.



0



1 / 1 / 2

Регистрация: 02.03.2014

Сообщений: 34

07.05.2015, 21:39

 [ТС]

9

ха-ха,
если я 100 раз проверил чтобы он в нужной директории лежал, и написал здесь об этом, я уже не понимаю почему он не находит его



0



Эксперт PHP

4839 / 3852 / 1598

Регистрация: 24.04.2014

Сообщений: 11,300

07.05.2015, 22:20

10

leWire, что ls -l выводит? tex.c — все символы в правильной раскладке



0



1 / 1 / 2

Регистрация: 02.03.2014

Сообщений: 34

22.05.2015, 04:42

 [ТС]

11

Причина была в том, что gpedit, или как то так, текстовой редактор в общем, имеет функцию выбора под какую систему сохранять текстовой файл, под windows или же под Linux, так как это связано с символом конца строки, который в какой то системе помещается, а в какой то нет, (точно не помню), так вот я не глядя сохранял под windows, а когда сохранил под linux, естественно все заработало.



0



0 / 0 / 0

Регистрация: 12.07.2021

Сообщений: 3

16.07.2021, 14:07

12

Гость — 2 Февраль, 2017 — 12:38
Тема старая, но для тех, кто попадет сюда с тем же вопросом – путь к каталогу с проектом не должен содержать кирилличных символов.

Гость — 7 Декабрь, 2017 — 16:42
Чтобы выполнялась компиляция на пути с кириллицей
в локализованной [ru] системе можно через меню CodeBlocks
Settings->Environment->View
установить параметр
[x] Internationalization (will take place after restart)
и перезапустить CodeBlocks.

нашел где то на каком то форуме, как вариант решения, мне помогло.



0



please help with eclipse

I just downloaded c/c++ IDE developer and made a C++ project. but then under problems tab, these come up and I cannot proceed to do anything else from there.

Program «g++» not found in PATH
Program «gcc» not found in PATH
sh-c «autoreconf-i»

fyi, I had a EE java developer installed previously, but when I downloaded c/c++ developer, I just clicked to replace all java’s with c/c++.

thanks for the help fellas

Looks like you haven’t got a compiler, or you’ve told eclipse to use the wrong one, or it’s not where eclipse expects to find it.

Last edited on

So what should I do?

Do you have a compiler?

isn’t eclipse the compiler? if not then how do i check?

No.

A compiler is a program that takes text files and turns them into binary object files.
A linker is a program than takes these binary object files and turns them into a neatly packaged library or an executable.
Often, the term «compiler» is taken to mean «compiler and linker», and they usually come as a pair.

An IDE is a set of nice tools that help you write the text files and use the compiler and linker. Eclipse is an IDE. SOmetimes an IDE comes with a compiler/linker. Sometimes it does not.

Go back to where you got Eclipse and check if it actually comes with the compiler. Perhaps there is a download with compiler, and a download without. You may have taken the one without.

Failing that, google for a C++ compiler for your chosen OS and see what you find. On linux, gcc (and its g++ guise) is common.

Last edited on

any suggestions on where I should look into? could you provide me with a link? i’m a newbie..

Last edited on

bumpp please help…

Last edited on

On that page is a link titled «Before you Begin».

Alright, I downloaded the MinGW. While installing, I clicked download latest repository catalogues, accepted the agreement, and when it asked me to choose which optional components of MinGW to install, I clicked c++ compiler, at the bottom though there are like msys basic system and mingw developer toolkit, which I did not click. After I installed it, I went to computer properties then environment variables and then added ;C:MinGWbin to Path. I then searched for cmd and typed in gcc. It outputted, gcc : no input files and in the next line said compilation terminated. I clicked eclipse and clicked C++ project. But still there was no MinGW GCC under Toolchains. All I saw was GNU autotools Toolchain.

Moschops, I appreciate you helping me but could you specify more as to what I should do step by step to get the eclipse to function properly? so that you won’t have to come back here and reply to every single problem that I encounter? that will be more beneficial to both of us. thanks in advance.

Short answer — no idea. I’ve never used Eclipse. I tried it once and I didn’t like it. I write my code in text files and manually compile them without an IDE.

Since it said gcc : no input files gcc clearly has been installed. All I can suggset now is that buried somewhere in Eclipse’s menus is an options to specify the compiler/location.

oh actually, I tried gcc again in cmd and this popped up, «gcc : fatal error : no input files» and below that is «compilation terminated.»

any clue?

Here is one way gcc works; you type «gcc» and then you type the name of the file you want it to compile.

For example,

gcc someFile.cpp

If you don’t provide the name of a file to compile, or any instructions, how does it know what you want it to do?

where do I provide that?

now I only get this error… sh-c «autoreconf-i»

can nobody fix this? this is problem something new??

I think you’re the first person I’ve met who uses Eclipse for C++. Now I know why :)

Your problems are not C++ problems — they’re Eclipse problems. You would get better responses at an Eclipse forum (like this http://www.eclipse.org/forums/index.php/t/366745/ )

Last edited on

Topic archived. No new replies allowed.

Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?
Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!

  • Форум русскоязычного сообщества Ubuntu »
  • Ubuntu Russian LoCo »
  • Разработка (Модератор: Azure) »
  • Нужна помощь насчет Eclipse Juno
  • Печать

Страницы: [1]   Вниз

Тема: Нужна помощь насчет Eclipse Juno  (Прочитано 739 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
MoHoXPOM

Доброго времени суток! При компиляции выдает ошибку — «Program «g++» not found in PATH». Не стоял компилятор С++. Странно, поставил. Теперь из терминала:
«g++:fatal error: no input files compilation terminated.»
Но в Eclipse ничего не поменялось, та же ошибка при компиляции. Кто сталкивался с такой ошибкой и как ее решить? Заранее благодарен за помощь.


  • Печать

Страницы: [1]   Вверх

  • Форум русскоязычного сообщества Ubuntu »
  • Ubuntu Russian LoCo »
  • Разработка (Модератор: Azure) »
  • Нужна помощь насчет Eclipse Juno

SMF 2.0.19 |
SMF © 2011, Simple Machines | Карта форума

Страница сгенерирована за 0.04 секунд. Запросов: 25.

Эта тема


  • Везде

  • Эта тема
  • Этот форум

  • Расширенный поиск

Поиск

Here is a summary of the most important steps:

  1. Download and install a JDK version 8 (Java Development Kit) 
    • from http://www.oracle.com/technetwork/java/javase/downloads/index.html, go to «JDK Download»
    • Run the installer
    • Check on the command line: java -version
    • If it says «command not found» or similar try this: Add the bin directory (e.g. C:Program FilesJavajdk1.8.x_xxbin) of the installed JDK to the PATH environment variable, as described here: http://www.java.com/en/download/help/path.xml
  2. Download Eclipse IDE for C/C++ Developers from http://www.eclipse.org/downloads/ (same bit version as for the JRE, i.e. 32 or 64 bit) and unzip e.g. to C:deveclipse
  3. Download and install a C/C++ compiler (you will need gcc) for Windows, 
    • e.g. MinGW (alternatively Cygwin): for MinGW read http://www.mingw.org/wiki/Getting_Started or http://www.mingw.org/wiki/InstallationHOWTOforMinGW
    • In the MinGW Installer choose «Basic Setup» and then the following packages:

    • add the bin directory (e.g. C:MinGWbin) to the PATH variable, as before in 1.
    • Check on the command line: gcc
    • You should get: gcc: fatal error: no input files. compilation terminated. (this means gcc is found!!!)
  1. Start Eclipse with eclipse.exe. Then:
    • File > New > C Project
    • Enter a project name of your choice e.g. «helloworld»
    • Select project type «Hello World ANSI C Project» and toolchain «MinGW GCC»

    • Edit the source file:
    #include <stdio.h>
    
    int main(void) {
     printf("C/C++ on Eclipse...n");
     return 0;
    }
    

  1. Initially build the project: either press Ctrl+B or click the «Hammer» button or right click the project and click «Build Project»
  2. Click the «Run» button. That’s it!

I wrote this simple line of code and saved it in a file called ‘ex.c’.
The code is the following (first line is purposely written wrong as it showed up different in the post):

"#include < stdio.h >

int lst[] = {6,3,7,9};

int main(){

  printf("Hellon");

  return 0;

}

I then wanted to compile it using the command gcc ex.c but I get an error saying «gcc: fatal error: no input files
compilation terminated.»

What am I doing wrong?
I use git bash and have installed both msys64 and MinGW to the C directory, aswell as add the gcc in my path enviorment.

Why is it not working?

Giovana Morais's user avatar

asked Aug 28, 2019 at 15:58

PCheck's user avatar

you should add the output executable name

gcc ex.c -o output and then you can execute your output file with /output.

all the other options are available in the gcc documentation

answered Aug 28, 2019 at 16:22

Giovana Morais's user avatar

13

The problem was that I had followed the instructions on the following page: https://github.com/is1200-example-projects/mcb32tools/releases/
But I had forgot the last step which is to download the .run file for msys, I did this and now it is working for MSYS2, Git Bash still not working, but one working is all I need!

STEPS I FORGOT (as taken from the link):

  • Download the .run-file for windows. Make sure you download the correct version.
    The x86_64 version is for 64 bit MSYS2 installation and the i686 version for a 32 bit MSYS2 installation.

  • Run the .run-file inside the MSYS2 environment (cd to containing directory, run with ./mcb32tools-*.run)»

answered Aug 28, 2019 at 19:03

PCheck's user avatar

PCheckPCheck

11 gold badge1 silver badge1 bronze badge

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Eclipse error log view
  • Eclipse error in final launch sequence
  • Eclipse cdt error
  • Edc 3063 01 ошибка ман тга
  • Edc 03929 01 ошибка ман

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии