| | |
Compiling on cmd...
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 12
Reputation:
Solved Threads: 0
Hi I want to know how to compile c++ codes using the command prompt in windows.
In linux I do
and run it using
but for windows when I try this procedure in compiling i got an error message
I know that the IDE already has a compile button...
please help...
In linux I do
C++ Syntax (Toggle Plain Text)
g++ filename.cpp -o filename
and run it using
C++ Syntax (Toggle Plain Text)
./filename
but for windows when I try this procedure in compiling i got an error message
•
•
•
•
'g++' is not recognized as an internal or external command,operable program or batch file
please help...
I trust you have installed all of the required libraries etc
And set up all global varialbles.
once all is set up i believe this should work
and to run it
And set up all global varialbles.
once all is set up i believe this should work
C++ Syntax (Toggle Plain Text)
g++.exe "C:\file.cpp" -o "C:\File.cpp" -I"Include directory" -I"another include directory and so on" -L"libraries"
and to run it
C++ Syntax (Toggle Plain Text)
start C:\file.exe
Last edited by Freaky_Chris; Oct 4th, 2008 at 1:25 pm.
Knowledge is power -- But experience is everything
Your Windows installation does not know where is the g++ executable. See
https://users.cs.jmu.edu/bernstdh/we..._mingw-faq.php
https://users.cs.jmu.edu/bernstdh/we..._mingw-faq.php
•
•
Join Date: Jun 2008
Posts: 12
Reputation:
Solved Threads: 0
I still have a problem... everytime i close cmd i always need to type
before i can use the g++ command.
Is there a way that I can directly use the g++ command after launching cmd?
C++ Syntax (Toggle Plain Text)
set PATH=%PATH;bin location
before i can use the g++ command.
Is there a way that I can directly use the g++ command after launching cmd?
•
•
•
•
I still have a problem... everytime i close cmd i always need to type
C++ Syntax (Toggle Plain Text)
set PATH=%PATH;bin location
before i can use the g++ command.
Is there a way that I can directly use the g++ command after launching cmd?
Yes follow these steps sorry if you already know, i'm going to assume your on XP
1) Right click my computer
2) Select Properties
3) Advanced Tab
5) Environment Variables
6) Under system variables find "Path"
7) Click edit and append with a semicolon separator the new location
And your done, hope that helps
Chris
Knowledge is power -- But experience is everything
![]() |
Similar Threads
- compiling using g++ results to undefined reference (C++)
- trouble compiling (Java)
- asm files compilation (Assembly)
- Virus Of Death - Help Needed! (Viruses, Spyware and other Nasties)
- Using Global Low-Level Hooks Without Using A Dll (Computer Science)
- Compiling Python (Python)
- Compiling Programs (C++)
- n00b needs help hiding the black box (C++)
Other Threads in the C++ Forum
- Previous Thread: Matrix
- Next Thread: C++ vectors problem
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game generator getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






