- Ошибки при компиляции «no input files»
- makefile with gcc returns fatal error: no input files
- 2 Answers 2
- Why does GCC (MinGW-w64) return a ‘fatal error: no input files’ when building MPFR?
- 2 Answers 2
- g++: fatal error: no input files #243
- Comments
- Haghrah commented Nov 6, 2018 •
- wsvdyk commented Nov 28, 2018
- LiamInfoSec commented May 17, 2019
- michael-rishi commented Jun 8, 2019 •
- wsvdyk commented Jun 8, 2019 •
- Gcc no input files windows
Ошибки при компиляции «no input files»
Не могу разобраться как исправить ошибки. Подсобите кто как может. Скриншот прилагается.
Ошибка при компиляции «Incompatible implicit declaration of built-in function ‘exit’»
ОС Linux Home 2.6.25-std-def-alt8.M41.4 #1 SMP Sat Dec 6 14:42:12 MSK 2008 i686 GNU/Linux пробую.
Ошибки при компиляции
Народ помогите откомпилить. При запуске make — ругается, что нет такого файла. Почему? Все файлы в.
Ошибки при компиляции Hello world в eclipse.
Скачал Eclipse IDE for C/C++ с сайта, распаковал, запустил, создал новый проект, написал #include.
Напишите функцию expand(s1), заменяющую строку на сокращенную запись. Например, «Иванов» будет заменена на «И-в»
Нуждаюсь в вашей помощи
Файлы лежат в /home/lolka.
Добавлено через 1 минуту
«/home/lolka/bad.txt» — так правильно?
Заказываю контрольные, курсовые, дипломные и любые другие студенческие работы здесь или здесь.
Для заданного массива из 10 чисел проверить, есть ли в нем два числа, отличающихся ровно на 1, напечатать «да» или «нет»
Для заданного массива из 10 чисел проверить, есть ли в нем два числа, отличающихся ровно на 1, и.
При получения пакета возникает ошибка «Segmentation Fault»
Добрый день! Учился отправлять структуру по сети, натолкнулся на глюк. Если комментирую/удаляю.
Ошибка при использовании команды «make»
Вылезает ошибка при использовании команды «make» gcc -c -Wall -I include -F /Library/Frameworks.
makefile with gcc returns fatal error: no input files
I am trying to create a makefile for a new project. the project contains so far just some basic main func and some funcs declarations. my makefile makes objects from source files, but no executable is compiled. exit with error:
this is my make file:
I’m simply running make. files hierarchy is:
- src dir
- app dir (contains main.c and more files)
- include dir (contains some .h files)
- lib dir (empty)
- test dir (contains another main.c file)
- Makefile file
2 Answers 2
Install GNU remake and run remake -X .
It will put you into a debugger and then you can run step to see step by step what the makefile is doing. Here is that applied to your Makefile:
See the link for videos. Or https://github.com/rocky/remake for some screen shots
Make’s output presents the commands it runs. For a serial build, at least, this unambiguously communicates what command produced each diagnostic message emitted. In your case, the command that caused the error immediately preceeds it in the output:
So what’s wrong with that? Why, exactly what the diagnostic says: it doesn’t specify any input files to operate upon. No C source files to compile, no object files or libraries to link. Nothing from which to build the designated output file.
Supposing that you’ve presented a complete makefile that produces the problem for you, that command must come from an attempt to build target all via this rule:
That’s a bit suspicious on its face, because an all target typically provides only a prerequisite list, not a recipe. Each prerequisite that may need to be built would then have its own rule. But it’s not inherently wrong to provide a recipe, and we need to consider the recipe itself to determine the nature of your problem. In this case, we have suspicious point #2: the recipe is specified entirely via a single variable. But I already knew that, because I had to trace through that to identify this rule as the source of the error in the first place.
In particular, the only place where the text bin/Main appears in the makefile is in this else block:
That indeed provides the command line variable referenced by the all target (and by nothing else), and it matches up cleanly with the command that causes the error. And what do we find when we match the bits of the command line to the variables from which that version of COMP_ARGS is built? We find that all the bits are covered by variables other than OBJECTS , which evidently expands to nothing (you can even see the separate leading and trailing space characters around its empty value). And why does OBJECTS expand to an empty value? Because it is never set when that branch of the conditional is exercised.
Personally, I would be inclined to rewrite the whole makefile to be more idiomatic and to rely less on GNU make extensions, but the simplest way forward would probably be to put an appropriate definition of the OBJECTS variable in the else block I pointed out.
Why does GCC (MinGW-w64) return a ‘fatal error: no input files’ when building MPFR?
I’m unable to diagnose the cause of an error when attempting to build MPFR 4.0.1 with MinGW-w64 8.1.0. I’m using msys2 and Windows 10. The result of running mingw32-make is:
The command used to execute configure was:
The GMP build I supplied was built by me and it passed all ‘make check’ tests.
Attempts to Fix Following advice given by Mike, I’ve fed gcc the corrected string via the CC flag, but get a new error as gcc can only write to one file:
The command is still messed up, as I now get this error:
Out of desperation, I’ve also tried:
- Rolling back to MPFR 3.1.6 (the version «recommended» by the MinGW-w64 port here: https://github.com/emphasis87/libmpfr-msys2-mingw64);
- Not using a bash script and running configure directly;
- Converting the bash script to ANSI instead of UTF-8;
- Using Cygwin;
2 Answers 2
In this commandline:
We see that in -DLT_OBJDIR=\».libs/\» there are balanced quotation marks that are escaped. However in libtool’s diagnostic:
we see that the first of those escaped quotes has been removed and replaced with another escape:
and that a new unescaped quotation mark has been prepended to the macro definition:
thus creating a quoted string argument for gcc that commences «-DLT_OBJDIR=\\.libs/\». and in fact consumes all the remainder of the commandline up to:
whereas in the original commandline we have:
From where I’m sitting, I cannot explain the cause of this escape/quotation corruption, but it is the answer to the question:
Why does GCC (MinGW-w64) return a ‘fatal error: no input files’ when building MPFR?
I suggest you direct your investigation to that with the advantage of being the guy on the spot.
g++: fatal error: no input files #243
Comments
Haghrah commented Nov 6, 2018 •
I am trying to compile and run a simple hello world c++ code. g++ says no input files:
g++: fatal error: no input files
compilation terminated.
It seems that the g++ is not running in the same directory which c++ file is placed or maybe file path is not correct in compilation command. How to solve the problem?
The text was updated successfully, but these errors were encountered:
wsvdyk commented Nov 28, 2018
hi @Haghrah Do you still have this issue? If so check if g++ is in your PATH variables by opening CMD and entering the following: «gcc —version» and «g++ —version». if you do not see information check you my issue #132
LiamInfoSec commented May 17, 2019
I have the same problem when I run «g++ —version»;
g++ (MinGW.org GCC-8.2.0-3) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
michael-rishi commented Jun 8, 2019 •
in my terminal i am trying to run a welcome.cpp file that’s code is
# include
using namespace std;
int main()
<
cout >> «Hello What’s your name »
char name = «»
cin > msg >> endl
cout >> «» >> endl
>
and when I type «g++ -o welcome.cpp» then enter this is what comes up
wsvdyk commented Jun 8, 2019 •
for one, your code will not compile, you have multiple fatal errors in your code.
#include is not used, is necessary for cout.
cout doesn’t use >>, but
Gcc no input files windows
I have spent a decent amount of time trying to get my gcc to work, but it won’t. Here’s what I tried:
sudo apt-get install gcc
//told me I had the latest version
gcc -o HelloWorld.c
gcc: no input files
gcc -Wall -ansi HelloWorld.c
//a bunch of stuff, like
HelloWorld.c:7: error: ‘cout’ undeclared (first use in this function)
I also used Tab to complete program name, so there are no errors of that sort. Also gcc complained at some point about not recognizing
Here is my program (copied directly from a book):
using namespace std;
gcc -o file.c will try to output a file called file.c, and no input file was given. You would probably want ‘gcc file.c -o file.bin’, which would input the file file.c, and output the file file.bin
EDIT: replace those first two lines in your file with ‘#include ‘
What book are you using? That’s some pretty odd looking C code.
EDIT #2: You might need some additional libraries to compile. try installing the package build-essential too
I’m trying to remember, but isn’t cout a C++ function? If so, have you tried using g++ in place of gcc?
I have spent a decent amount of time trying to get my gcc to work, but it won’t. Here’s what I tried:
sudo apt-get install gcc
//told me I had the latest version
gcc -o HelloWorld.c
gcc: no input files
gcc -Wall -ansi HelloWorld.c
//a bunch of stuff, like
HelloWorld.c:7: error: ‘cout’ undeclared (first use in this function)
I also used Tab to complete program name, so there are no errors of that sort. Also gcc complained at some point about not recognizing
Here is my program (copied directly from a book):
using namespace std;
There is nothing wrong with your original code, it’s just not C it’s C++.
g++ is the linux c++ compiler.
Thanks to all. I changed my code to the following and I installed/compiled with g++.
If you want this to compile as C++, try:
using namespace std;
A C version would be
int main()
<
printf(«Hello World»);
return 0;
>
Thanks to all. I changed my code to the following and I installed/compiled with g++.