Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

sab3156

Command Line Compiling

This topic is 5772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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++?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If your using gcc Try g++.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!