I'm simply trying to print out Hello world. I installed minGW, but the code simply won't work. It gives a "can't find path" error, but I have completed everything to download minGW, and the command prompt shows nothing wrong when I typed cd desktop. Additionally, I enabled theVSC to run on the terminal, but it won't work.
I am expecting the code to print Hello world, but this is what it prints out:
cd : Cannot find path 'C:\MinGW\binc\Users\Harold\Desktop\waffle\' because it does not exist.
At line:1 char:1
+ cd "C:/MinGW/binc/Users/Harold/Desktop/waffle/" ; if ($?) { g++ test. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\MinGW\binc\U...Desktop\waffle\:String) [Set-Location], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
Related
In my folder are these files:
hello.cpp hello.exe hello.ilk hello.pdb
When I try to execute the .exe file within a terminal in VS Code I receive this:
C:\Users\User\Documents\VS_Code> hello.exe
hello.exe : The term 'hello.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ hello.exe
+ ~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (hello.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command hello.exe was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\hello.exe". See "get-help about_Command_Precedence" for more details.
When I'm running it from the developer prompter from Visual Studio it works.
I think your issue can be solved by just looking at the error suggestion. It says to use .\hello.exe .
Hope this helps :)
I'm trying to set c/c++ environment in my visual studio code. I have installed the mingw and set the environmental variable of the bin folder. However upon running a code in vs code, it shows the following error:
g++ : The term 'g++' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and
try again. At line:1 char:40
cd "e:\vsCodes\Cpp Codes" ; if ($?) { g++ threen1.cpp -o threen1 } ; ...
CategoryInfo : ObjectNotFound: (g++:String) [], CommandNotFound Exception
FullyQualifiedErrorId : CommandNotFoundException
But command prompt shows the following message when I enter g++ --version:
g++ (tdm64-1) 10.3.0 Copyright (C) 2020 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.
I have tried solving the issue following the answers in this thread.
You are using powershell terminal, If you dont know what powershell is or you dont need powershell, I recommend you to run Command prompt terminal (cmd). It's available in terminal menu here:
In powershell you can verify that g++ in PATH running this command echo $env:path, it's powershell equivalent of echo %PATH%
I feel like this is a very trivial question, I cannot figure out for the life of me what is going on with my VScode.
that the path is correct and try again.
At line:1 char:1
+ make
+ ~~~~
+ CategoryInfo : ObjectNotFound: (make:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command make was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\make". See "get-help about_Command_Precedence" for more details.
I am just trying to compile two files together to make them work. They compile and execute seperately, but when I use the 'make' command, in the terminal within VS, it delivers this error.
I believe that my makefile is setup correctly, literally following my professors video on how to do it and it's working properly.
Any pointers??
As the message says: Make command is not found!
Make sure your make command does exist by simply typing make and hitting enter.
if it does not exist install both: build-essentials and make using pip/conda/npm/npx
These are the main rules to make the target work!
I'm learning C++ for the first time (im using microsoft visual studio code) and i'm trying to run my code based on the video im watching. I have exactly what he has in the video but i have an error;
PS C:\Users\Baseb> g++ cpplearning.cpp
g++ : The term 'g++' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify
At line:1 char:1
g++ cpplearning.cpp
+ CategoryInfo : ObjectNotFound: (g++:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException .
I have downloaded minGW and the path i was using is; C:\MinGW\bin . Do you know why I am getting this error code? I typed G++ --version and it shows I do have G++ installed on my computer.
Thank You
If you run g++ from a terminal and it is a Windows terminal (cmd or other), you have to include the g++ binary path in the Windows PATH environment variable.
If you run the compiler from VS then follow the link from #Eljay comment.
So I am running on 64-bit Windows 7, and I set up Pyinstaller with Pip and PyWin32. I have python 2.7.
I made a simple hello world Program with this code
print "hello world!"
I put the file in the same directory as PyInstaller, and ran this code in the command prompt
pyinstaller.py helloWorld.py
Yet, when I try that, I get this error message:
Error loading Python DLL: C:\PROGRA~1\PYINST~1.1\build\HELLOW~1\python27.dll (error code 126)
What am I doing wrong and how do I fix this?
Run with the -F flag to produce the standalone exe:
pyinstaller -F helloworld.py
It will output to dist/helloworld.exe
NOTE this is a different location to when -F is not used, be sure to run the right exe afterwards.
Thanks #tul! My version of pyinstaller put it to dist\helloworld.exe though!
If you start it from C:\Python27\Scripts... that'll be C:\Python27\Scripts\dist... as well!
But whereever you have it, I recommend putting a batch file next to your .py to be able recompile any time with just a click:
I set it up so there is nothing but the .exe at the .py location and the temporary stuff goes to the temp dir:
#echo off
:: get name from filename without path and ext
set name=%~n0
echo ========= %name% =========
:: cut away the suffix "_build"
set name=%name:~0,-6%
set pypath=C:\Python27\Scripts
set buildpath=%temp%
if not exist %name%.py (
echo ERROR: "%name%.py" does not exist here!
pause
exit /b
)
%pypath%\pyinstaller.exe --onefile -y %~dp0%name%.py --distpath=%~dp0 --workpath=%buildpath% --specpath=%buildpath%
I name it like the .py file plus "_build" and cut away the suffix in the batch script again.
VoilĂ .