#when i try to run cpp program hello world it is not displaying in the console can anybody help me

58 messages ยท Page 1 of 1 (latest)

dry leaf
#

when i try to run cpp program hello world it is not displaying in the console can anybody help me fix this issue like i have install everything reletaed to compiler like mingw msys and i am still unable to print hello world

clever robinBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@dry leaf

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

hot sluice
#

Try typing g++ Untitled-1.cpp -o Untitled-1 -static ; .\Untitled-1 in the terminal

#

Does that work?

dry leaf
#

yes i tried i sitll get same error

keen hull
#

there's an error?

dry leaf
hot sluice
#

Alright

dry leaf
#

like this is the most annoying part i am trying to learn cpp i am new to cpp

hot sluice
#

Type echo $env:PATH and show the result

modern lotus
#

Honestly using Visual Studio/CLion/Rider would save you all of this headache

dry leaf
#

oh so i should stop vscode then

hot sluice
#

There's minimal headache

dry leaf
#

this is what i get

#

??

hot sluice
modern lotus
hot sluice
#

Didn't get what part? ๐Ÿ˜›

dry leaf
#

i mean See C:\msys64\ucrt64\bin right in the middle? It should be as close to the beginning as possible. Move it there as described here:

unique trout
dry leaf
#

how does it help in mvoing the path file

hot sluice
#

Read the link, it explains what to do

dry leaf
#

this is the path

unique trout
# dry leaf

right so something went wrong in compilation
run just

g++ Untitled-1.cpp -o untitled

and show what it shows

dry leaf
#

i get nothing

unique trout
#

now run ./untitled

dry leaf
unique trout
hot sluice
#

Save the changes, restart vsc, type echo $env:PATH again, and hopefully it should be closer to the beginning of the list

dry leaf
#

Ok sure

unique trout
# dry leaf

@hot sluice dont u think this is weird ? even if it did choose the wrong g++ , shouldnt it atleast make a exe ?

hot sluice
unique trout
#

hmmm , interesting

hot sluice
#

On Linux this is not a problem because executables hardcode library search paths. While on Windows they normally only search in their own directory and in PATH (and some other places)

hot sluice
dry leaf
#

i have moved up and restared my vsc

#

yes it did work

#

but how does moving C:\msys64\ucrt64\bin this to top work not at bottom i am super confused

#

like the order does not matter right

hot sluice
#

It does matter ๐Ÿ˜›

dry leaf
#

oh i am new to cpp can you guide me what topics i need to learn

#

and where to practice cpp

#

i am currently watching videos from cherno

dry leaf
hot sluice
#

You're welcome ๐Ÿ˜›

#

I don't have a list of topics for you.
People usually recommend text tutorials or books, instead of videos, since they're usually more accurate. But that's up to you
If you decide to go with a book, I heard Stroustrup's PPP is alright

dry leaf
#

but the maain problem with books is get i get pretty bored and sleep quickly i am more of visual learner but i need to practise cpp real world project

hot sluice
#

But anyway, if videos work ok for you, continue with videos I guess?

dry leaf
#

ok sure but if i don't understadning i can raise my doubts hear right

hot sluice
#

Ofc

dry leaf
#

thanks