#I’m having a problem running my first program
10 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.
Are you using windows or linux? Are you able to browse the file system on your own?
Use cd on mac/(i think linux) and chdir on windows to change the directory to where the file is.
For example
# If the codefile was at
cd Documents/Code/main.cpp
chdir Documents/Code/main.cpp
# Then you do this to get into the directory
cd Documents/Code
chdir Documents/Code
Then you can run this on mac and linux systems (i think) to quick compile a single file into an executable.
# compiler_name, file(s), -o, executable name
# For example
g++ main.cpp -o main
i think the same thing will work with clang++
idk about windows
hope it helps
you can of course compile the file by just putting in the file path by itself, but its usually easier to change directories first
In case you are using Visual Studio Code, with the C/C++ extensions, you can just select the Run menu, you will be able to select from the installed compilers that VS Code detects.
This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.