Compilation terminated error in linux

gcc: fatal error: no input files compilation terminated

I’m new to linux environment. I created a file s1.c in a folder named ‘program’ which is present in desktop. When I try to compile my code using «/program gcc s1.c » it’s showing «gcc: error: s1.c: No such file or directory gcc: fatal error: no input files compilation terminated.» What may be the problem

2 Answers 2

It seems like you are not in the same directory or you are not firing the command for program folder where s1.c file is located.

Make sure that you are running gcc s1.c while you are in program directory or you can try gcc program/s1.c if you are not in program directory.

You can refer this attached image for more info.

Not the answer you’re looking for? Browse other questions tagged compiling gcc or ask your own question.

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

gcc compilation terminated with «fatal error: string: No such file or directory #include «

My situation. uname -a gives Linux computer2 4.4.0-62-generic #83

14.04.1-Ubuntu SMP Wed Jan 18 18:10:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

I am trying to install HDF5 1.8.18 with GNU make 3.81 invoking gcc 6.3.0. I have successfully installed this gcc 6.3.0 alongside the version 4.8.4 that is shipped with the Ubuntu distribution.

My gcc 6.3.0 lives in /opt/gcc/6_3_0/ . I use the following script to configure and pass on the commands, libraries and headers in non-standard directories:

Читайте также:  What is ssh daemon linux

where $ is an installation directory, $ is where zlib lives and the other switches are standards as per the installation guidelines

The configure step goes well. The make step fails with the error:

If I understand it correctly, some header file is missing, and of a basic nature.

  • Where should I get it from?
  • Is there any flaw in the names and values of the environment variables?

StackExchange contains a host of posts on this error, but they seem to be mostly related to coding exercises. My aim is not to edit codes, rather to compile source codes successfully with my vanilla gcc 6.3.0.

Updated question

In the light of the helpful comments and Thomas Dickey’s answer below, it appears that a promising avenue is to install matching versions of libstdc++ and gcc . I have searched around in the GCC website and it appears that one can configure gcc with the following switch

Specify that runtime libraries should be installed in the compiler specific subdirectory (libdir/gcc) rather than the usual places. In addition, libstdc++’s include files will be installed into libdir unless you overruled it by using —with-gxx-include-dir=dirname. Using this option is particularly useful if you intend to use several versions of GCC in parallel. This is currently supported by ‘libgfortran’, ‘libstdc++’, and ‘libobjc’.

Источник

compilation error on ubuntu #166

Comments

ORESoftware commented Sep 12, 2019

I am getting this error:

compilation terminated. error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1 —————————————- Failed building wheel for bjoern Running setup.py clean for bjoern Running setup.py bdist_wheel for psutil: started Running setup.py bdist_wheel for psutil: finished with status ‘done’ Stored in directory: /pth/to/downloaded/files/wheels/90/7e/74/bb640d77775e6b6a78bcc3120f9fea4d2a28b2706de1cff37d Running setup.py bdist_wheel for sshtunnel: started Running setup.py bdist_wheel for sshtunnel: finished with status ‘done’ Stored in directory: /pth/to/downloaded/files/wheels/e8/d2/38/b9791b7391f634099194ec6697fa671194f3353906d94c8f92 Successfully built cairocffi future inflection langdetect mako marisa-trie mongoalchemy nltk pycparser pymongo pyramid-mako pysocks pyyaml regex sqlalchemy validators wikipedia pyramid-handlers googlemaps psutil sshtunnel Failed to build bjoern Installing collected packages: asn1crypto, soupsieve, beautifulsoup4, numpy, blis, urllib3, botocore, boto3, boto, pycparser, cffi, setuptools, cairocffi, chardet, certifi, idna, requests, future, census, iso8601, translationstring, colander, webencodings, tinycss2, cssselect2, cx-oracle, cymem, decorator, defusedxml, elasticsearch, envoy, smmap2, gitdb2, gitpython, httplib2, hupper, inflection, six, isodate, jsonpickle, jsonschema, langdetect, lxml, markupsafe, mako, marisa-trie, pymongo, mongoalchemy, more-itertools, murmurhash, pyopenssl, ndg-httpsclient, nltk, oauthlib, pytz, pandas, paste, pastedeploy, pillow, plac, plaster, plaster-pastedeploy, preshed, pygments, pyparsing, repoze.lru, venusian, webob, zope.deprecation, zope.interface, pyramid, pyramid-mako, pyramid-debugtoolbar, transaction, pyramid-tm, pysocks, pyyaml, quandl, rdflib, redis, regex, requests-oauthlib, scipy, tqdm, wasabi, srsly, thinc, spacy, sparqlwrapper, sqlalchemy, tweepy, unidecode, validators, waitress, webtest, wikipedia, zope.sqlalchemy, pyramid-handlers, googlemaps, bjoern, cairosvg, psutil, bcrypt, pynacl, paramiko, sshtunnel Found existing installation: asn1crypto 0.24.0 Not uninstalling asn1crypto at /usr/lib/python3/dist-packages, outside environment /usr Found existing installation: urllib3 1.25.3 Uninstalling urllib3-1.25.3: Successfully uninstalled urllib3-1.25.3 Found existing installation: botocore 1.12.157 Uninstalling botocore-1.12.157: Successfully uninstalled botocore-1.12.157 Found existing installation: setuptools 39.0.1 Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr Found existing installation: idna 2.6 Not uninstalling idna at /usr/lib/python3/dist-packages, outside environment /usr Found existing installation: six 1.11.0 Not uninstalling six at /usr/lib/python3/dist-packages, outside environment /usr Found existing installation: nltk 3.4.4 Uninstalling nltk-3.4.4: Successfully uninstalled nltk-3.4.4 Found existing installation: PyYAML 3.13 Uninstalling PyYAML-3.13: Successfully uninstalled PyYAML-3.13 Running setup.py install for bjoern: started Running setup.py install for bjoern: finished with status ‘error’ Complete output from command /usr/bin/python3 -u -c «import setuptools, tokenize;__file__=’/tmp/pip-build-k55q9ikw/bjoern/setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, __file__, ‘exec’))» install —record /tmp/pip-i0kkx69r-record/install-record.txt —single-version-externally-managed —compile: running install running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying bjoern.py -> build/lib.linux-x86_64-3.6 running build_ext building ‘_bjoern’ extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/http-parser creating build/temp.linux-x86_64-3.6/bjoern x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWANT_SENDFILE=1 -DWANT_SIGINT_HANDLING=1 -DWANT_SIGNAL_HANDLING=1 -DSIGNAL_CHECK_INTERVAL=0.1 -Ihttp-parser -I/usr/include/libev -I/usr/include/python3.6m -c http-parser/http_parser.c -o build/temp.linux-x86_64-3.6/http-parser/http_parser.o -std=c99 -fno-strict-aliasing -fcommon -fPIC -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -g x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWANT_SENDFILE=1 -DWANT_SIGINT_HANDLING=1 -DWANT_SIGNAL_HANDLING=1 -DSIGNAL_CHECK_INTERVAL=0.1 -Ihttp-parser -I/usr/include/libev -I/usr/include/python3.6m -c bjoern/_bjoernmodule.c -o build/temp.linux-x86_64-3.6/bjoern/_bjoernmodule.o -std=c99 -fno-strict-aliasing -fcommon -fPIC -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -g In file included from bjoern/wsgi.h:2:0, from bjoern/_bjoernmodule.c:3: bjoern/request.h:4:10: fatal error: ev.h: No such file or directory #include ^

Читайте также:  No repository found linux

compilation terminated. error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1 —————————————- Command «/usr/bin/python3 -u -c «import setuptools, tokenize;__file__=’/tmp/pip-build-k55q9ikw/bjoern/setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, __file__, ‘exec’))» install —record /tmp/pip-i0kkx69r-record/install-record.txt —single-version-externally-managed —compile» failed with error code 1 in /tmp/pip-build-k55q9ikw/bjoern/ The command ‘/bin/sh -c pip3 install —cache-dir=»/pth/to/downloaded/files» -r ‘/interos/temp/requirements.txt’ -c ‘/interos/temp/constraints.txt» returned a non-zero code: 1 «>

The text was updated successfully, but these errors were encountered:

Источник

how to fix fatal error jvmti.h No such file or directory compilation terminated c code ubuntu?

how to fix fatal error jvmti.h No such file or directory compilation terminated c code ubuntu? my c code is:

include «jvmti.h»

JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) <

/* We return JNI_OK to signify success */ printf(«\nmy name is,\n\n»);

JNIEXPORT void JNICALL Agent_OnUnload(JavaVM *vm)

type this command in terminal: gcc -Wall -W -Werror first_agent.c -o firstagent

first_agent.c:1:19: fatal error: jvmti.h: No such file or directory compilation terminated.

where java jdk version javac 1.7.0_25

where gcc version gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-2ubuntu4)

here should update gcc version to 4.8?

2 Answers 2

This question is now pretty old, but probably someone will stumble across this in the future.

As @Gyro Gearless already mentioned, you need to specify the «Include directories».

For Java 8 on Ubuntu 15.04 I found the folders at

In this directories you can find the following header files:

  • classfile_constants.h
  • jawt.h
  • jdwpTransport.h
  • jni.h
  • jvmticmlr.h
  • jvmti.h

which are needed by the compiler to include.

If you are using Netbeans you can add those include directory via the properties of your project:

Источник

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:

Читайте также:  Что больше всего нагружает windows 10

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

Источник

Оцените статью