g++: CreateProcess: No such file or directory [duplicate] - c++

This question already has answers here:
MinGW error: No such file or directory exists [closed]
(3 answers)
Closed 8 years ago.
System:
g++ version: g++ (TDM-2 mingw32) 4.4.1
windows 7 32 bit
Env path: C:\Python33\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Dwimperl\perl\bin;C:\Dwimperl\perl\site\bin;C:\Dwimperl\c\bin;C:\Program Files\QuickTime\QTSystem\;C:\Cygwin\bin;C:\Program Files\CodeBlocks\MinGW\bin;
Error:
C:\Program Files\CodeBlocks\MinGW\bin>g++ -o first.exe D:\first.cpp
g++: CreateProcess: No such file or directory
I took look on similar questions on SO, but none of them have answers for me.
Per one suggestion, I added Mingw, path to env variable path, as seen above.
Update: First I never believed this, but this worked for me.
MinGW error: No such file or directory exists

This error is most likely caused by a problem with PATH. I suspect that in your case g++ tries to run some utility in PATH, but fails, because of error in PATH, or because wrong g++ is executed with given parameters. For example, you might have some tool in C:\Cygwin\bin.
If that helps anybody, my case for the error was invalid slash in PATH, which was set as:
set PATH=%PATH%;"E:\godot.src\.locally/mingw32\bin"
Replacing the last entry in PATH with the stuff below fixed that:
E:\godot.src\.locally\mingw32\bin

Related

fatal error: boost/version.hpp: no such file or directory on Wndows

Error on Git Bash
Hi, me and my tutor are working on a ML software that requires C++ and boost library (version >= 1.68.0). I have boost 1.78.0 installed in C:. When I try to run the software under the correct directory (C:\Admin\Desktop\smartspec\scenario-generation) with the given code g++ -std=c++17 entitygen.cpp -o entitygen or make entityGenCompile I get the error on the screenshot. The file does exist, the path exist, there is everything to make it function but it just doesn't and it's quite frustrating. We didn't find anything helpful on the net, I'm using Windows 7 by the way.
Thanks :)

Using makefile in macOS terminal [duplicate]

This question already has answers here:
makefile:4: *** missing separator. Stop
(17 answers)
Closed 1 year ago.
I'm new to macOS terminal commands and have recently got introduced to makefiles while learning to program in C++.
The makefile that I was using had the following content:
fact:factorial2.o facth.o
c++ factorial2.o facth.o -o fact
facth.o:facth.cpp
c++ -c facth.cpp
factorial2.o:factorial2.cpp
c++ -c factorial2.cpp
All the files, factorial2.cpp and facth.cpp are present in the same folder as makefile.
On entering 'make' command in the terminal, I received the following:
makefile:2: *** missing separator. Stop.
Kindly help me out with this and tell me where exactly I'm making the mistake as I'm not able to figure out the same. For my friends using Ubuntu, the above works perfectly.
Makefiles use tab delimeters rather than 4 spaces. Replace the spaces with tabs on lines 2, 4, and 6.

error when trying to compile with MinGW: cannot execute cc1plus

I did a clean install of MinGW on Windows 7 32bit with the GUI Installer, and installed
ming32-base-bin
mingw32-gcc-g++-bin
msys-base-bin
When trying to compile a simple "Hello World.cpp" from the cmd.exe i get the error:
C:\Users\Lorenzo\Desktop>g++ "Hello World.cpp" -o"Hello World.exe" -m32
g++: fatal error: cannot execute 'cc1plus': CreateProcess: No such file or directory.
compilation terminated.
The weird thing is that by grabbing the file from the desktop and putting it over g++.exe (so that i open the file with the application) in the MinGW directory, i don't get any error.
A temporary fix i found was to have a new environmet variable pointing in the folder where cc1plus is (C:\MinGW\libexec\gcc\mingw32\9.2.0). The program runs but doesn't include the libraries from C:/MinGw/lib and C:/MinGw/Include, i have to include those manually, which shouldn't occur (i guess).
I don't want to do this crude fix since i know i'll encounter some other problems with time.
Ok. I found the solution with some luck.
It is as simple as adding .exe to g++
> g++.exe *input file* -o*output.exe*
Don't Know if it's a bug or not, but this works for me.
I'm not sure which MinGW you used exactly, but it's better to use MinGW-w64.
There is a standalone build you can get from http://winlibs.com/ that doesn't require installation. The site also gives some instructions on how to use it.

mac OS looking for nonexistent path to g++ after update to High Sierra 10.13.1

I got the following error when trying to run g++ from the command line (worked in Makefile):
$ g++ main.cpp
-bash: /usr/local/bin/g++-6: No such file or directory
I have a directory named /usr/local/bin/g++-7. Changing the directory name to g++-6 solved the problem, but I'm confused on why the OS didn't know to look for g++-7.
How can I tell my mac to look for /usr/local/bin/g++-7 instead?
There is a symlink/alias issue somewhere on your machine. If I were you I would update with homebrew. That should fix your issue in a correct/permanent way.
You can also try to create an alias to g++-7 however this would need to be done anytime you update gcc/g++. To do this, open ~/.bash_profile in vim/nano/emacs/textmate (your choice here really) and add:
alias g++='g++-7'
Good luck!

Compiling DISLIN gfortran

I am having trouble compiling Fortran code with references to DISLIN. I have downloaded DISLIN from the website, unzipped the file and ran the setup. I have added an environment variable called DISLIN (C:\dislin) and added C:\dislin\win to the PATH section of my system variables.
I am trying to compile some example code of the DISLIN website which includes line
USE DISLIN
I am using a MinGW shell to compile with command gfortran -o progrname -ldislin EX11_1.f90 and am getting the following error:
Fatal Error: Cant open module file 'dislin.mod' for reading at (1): No such file or directory.
I have tried changing the variable path and even moving the dislin.mod file (which is there) but still get the same message.
Ok I fixed this problem so thought I come back and post what worked for me incase any one else needs it...
Install both DISLIN and MinGW on the c drive
Copy disgf.a from /c/dislin and dislin.f90 from /c/dislin/gf into the directory containing your fortran files
(for me this is /c/MinGW/pnote)
Using the MinGW shell navigate to you files: cd /c/MinGW/pnote
compile dislin.f90 and your fortran program: gfortran -c dislin.f90 progName.f90 (dislin.f90 obviously only needs to be done once)
link libraries etc and compile: gfortran progName.o disgf.a -luser32 -lgdi32 -lopengl32 -o exeName
'run' exeName
You probably need to specify the path to the DISLIN module files:
gfortran EX11_1.f90 -o progrname -ldislin -I/path/to/DISLIN/modules
and, if not already configured like described here, also the path to the library itself:
gfortran EX11_1.f90 -o progrname -ldislin -I/path/to/DISLIN/modules \
-L/path/to/DISLIN/library
They provide a batch file (windows) to do the compiling and linking for you.
f90link -c My_Program
This is located in c:\dislin\Win
Also, if you are having trouble with the dislin.mod file which resides in c:\dislin\gf then recompile that with the -c compile option. I found all of this info in c:\dislin\readme.inf
near as I can tell (Jan 2018) dislin (64 bit) fails miserably with gfortran 7.2, period; and probably with many other newer compilers.
When trying to link, gfortran 7 says 'dislin.mod' is an unrecognizable format.
I think this program is highly dependent on exactly correct version synchronization - something that renders such software useless imho after many years in research.
and no, the correctness of various 'paths' seems not to help.
after all, gnuplot works, "at all". Not sure why I spent so much time on brand x.
jrc