Sign in with
Sign up | Sign in
Your question

Help with gcc compiler

Last response: in Applications
Share
May 31, 2012 4:04:44 PM

Hi, i'm a total newbie on programming with zero background on it

I'm currently studying C language now, my problem is


How do i set the gcc directory

the default is C:\users\name

so i need to put my .c files in that directory, i want it to be in my desktop

second problem is

cmd automatically closes after running and compiling using dev c++

any help will be greatly appreciated

thanks

More about : gcc compiler

a b L Programming
May 31, 2012 4:09:08 PM

Is there a particular reason why you are using gcc on Windows? It's a great compiler but perhaps not the easiest to use for a beginner. Have you had a look at Visual Express C++ (despite the name it's a C compiler as well as a C++ one). I think you would find the integrated development environment and built in debugger would make life much easier for you than gcc.
m
0
l
May 31, 2012 4:15:57 PM

I use gcc compiler because its only the compiler that my professor allowed X_X
m
0
l
Related resources
June 14, 2012 4:48:31 AM

The console application that you programmed automatically closes because at the end of the program you probably didn't put in a pause period or a input function. As for changing the default save location. Go to tools, environment options, files and directories, then users default directory.
m
0
l
a b L Programming
June 14, 2012 9:51:29 AM

Yes, the most common reason for console applications closing quickly is because you didn't give it any reason to remain open. Applications execute the instructions you give them and nothing more. If you don't tell it to wait for anything it will terminate very quickly. Usually you will get it to wait for user input at the end. Most (Windows-based) IDEs also have the ability to launch console applications and keep the window open at the end by automatically calling system("pause") just before the application terminates. Don't explicitly add this yourself though as system("pause") is bad, bad, bad.

On a side note: you should ask your professor why he wants you to use a 7 year old IDE just so that you can use GCC.
m
0
l
!