Command Line Compiling

Started by
7 comments, last by sab3156 21 years, 2 months ago
OK, I have used GCC on RedHat Linux 8 a couple times. Now, I would like to use command-line compiling in Windows using the Dev-C++ compiler.... is that possible? If so, how can I set up my machine so it can use it similar to Sun''s SDK for java....you know how that works...you just set up the paths in autoexec.bat and you can type in > javac file.java ...compiles > java file so, how can i set it up so i can use maybe GCC or C++ as commands to compile from DOS?
Air-Conditioners are like computers. They stop working when you open windows.
Advertisement
You just need to add the location of gcc and the other executables to your path. So if you installed Dev-C++ to C:\DevCPP, the compilers might be in C:\DevCPP\bin (or something like that - it''s been a while since I''ve used Dev-C++). Just add that directory to your path, and you''re set.
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
do you know how it''s done? like this is how you do it with java

set path=%path%;c:\jdk1.4.1\bin\
set classpath=%classpath%;.\


but how do you do it with the C++ compiler? is it:

set path=%path%;c:\dev-c++\bin\


???? im confused.
Air-Conditioners are like computers. They stop working when you open windows.
I''m not sure on the specifics of the Dev-C++ compiler, but the Borland command line compiler has instructions on how it works so you could go to their site and apply it to Dev-C++ or maybe even give Borland a shot
quote:Original post by sab3156
but how do you do it with the C++ compiler? is it:

set path=%path%;c:\dev-c++\bin\

If the compilers & other binaries are in c:\dev-c++\bin, then yes, that''s exactly how you would do it.
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
ok i did

set path=%path%;c:\dev-c++\bin\


but when i compile i get this:

> gcc -o test test.cpp
test.cpp:1: No include path in which to find iostream.h
>


?????? hmm... does anybody know how to set the include and library paths in autoexec?
Air-Conditioners are like computers. They stop working when you open windows.
ok now i want to know this: is gcc only the c compiler? if so, which is the C++ command line compiler that comes with dev-c++?
Air-Conditioners are like computers. They stop working when you open windows.
If your using gcc Try g++.
gcc will detect if it''s a C or C++ file (by the extension, .c for C files, .c++, .cc, .cpp for C++).

You also need to set the INCLUDE and LIB variable to point to your includes and libraries. Do it just the same as you would for the path.

If I had my way, I''d have all of you shot!

codeka.com - Just click it.

This topic is closed to new replies.

Advertisement