473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Compiler Question

24
I am starting to get back into C++ Programming. I am a beginner. Can someone let me know what type of compiler is the best. Is it worth it to buy one or are the free ones good enough. Please list your favorite compiler too.
May 30 '08 #1
12 2364
Laharl
849 Expert 512MB
Get a free one. The free compilers are good enough that you don't need to pay anymore. If you're using Windows, grab Dev-C++ or Cygwin if you want some Unix in your Windows. MinGW is also a thought. I use Linux, so gcc comes standard and thus I don't really have a 'favorite' compiler/IDE. Actually...Visual Studio is free now, isn't it? That's not a horrible choice (recommending nearly anything Microsoft makes sticks in my craw).
May 30 '08 #2
arnaudk
424 256MB
As far as windows is concerned I wouldn't recommend MinGW's gcc as I've had some strange problems problems with it (which I didn't have using gcc on linux or mac). Get a compiler specifically made for windows, like the one that comes with VC++ express (it's free).
May 30 '08 #3
curls8
24
Get a free one. The free compilers are good enough that you don't need to pay anymore. If you're using Windows, grab Dev-C++ or Cygwin if you want some Unix in your Windows. MinGW is also a thought. I use Linux, so gcc comes standard and thus I don't really have a 'favorite' compiler/IDE. Actually...Visual Studio is free now, isn't it? That's not a horrible choice (recommending nearly anything Microsoft makes sticks in my craw).
Thanks, I just downloading Dev-C++. I just tried to make a simple Hello World, it compile find, but when I tell it to Run a small black screen just flashes and that is it, I am not seeing my program excute. Do you happen to know what is wrong?
May 30 '08 #4
oler1s
671 Expert 512MB
Nothing is wrong. Your program is doing exactly what it is supposed, and so is Windows. You don’t have a console window open, so when you run a console program (the kind you just created), Windows opens up a console for you, runs the program there, and then closes the console when the program is done.

The correct way:
Learn to use the Windows console to run programs. There is a powertoy called “Open Command Window Here” or something along those lines. Comes in pretty handy, I think.

Might be possible:
I know this is true in Visual Studio, but I don’t recall for Dev-C++. There may be a way to run the program from Dev-C++, and have the IDE force the window to stay open. Look at the different ways you can run it. “Debug” is also one way to run the program, and may force the window to stay open.

The bad way:
Put a hack in your program. Look on Google for all the different hacks people have come up with to avoid doing it the correct way.
May 30 '08 #5
curls8
24
As far as windows is concerned I wouldn't recommend MinGW's gcc as I've had some strange problems problems with it (which I didn't have using gcc on linux or mac). Get a compiler specifically made for windows, like the one that comes with VC++ express (it's free).
I downloaded the Dev-C++ MinGW's gcc one before I saw this. Should I remove it and install a next one. There is an excutable only one and a source code.
May 30 '08 #6
curls8
24
Nothing is wrong. Your program is doing exactly what it is supposed, and so is Windows. You don’t have a console window open, so when you run a console program (the kind you just created), Windows opens up a console for you, runs the program there, and then closes the console when the program is done.

The correct way:
Learn to use the Windows console to run programs. There is a powertoy called “Open Command Window Here” or something along those lines. Comes in pretty handy, I think.

Might be possible:
I know this is true in Visual Studio, but I don’t recall for Dev-C++. There may be a way to run the program from Dev-C++, and have the IDE force the window to stay open. Look at the different ways you can run it. “Debug” is also one way to run the program, and may force the window to stay open.

The bad way:
Put a hack in your program. Look on Google for all the different hacks people have come up with to avoid doing it the correct way.
So is there any free program that let me see my work? I am going to try the 'correct way' although I have no idea what it is. Is it something already on my computer or should I just google it?
May 30 '08 #7
curls8
24
Ok so the Console is the C Prompt, do I just program in there. Is there a frustration smilie. I am trying to do a quick program fast while my toddler is busy and this is a huge setback. (Ok breathe..)

I saw a small example of how to do it on Yahoo answers. It is looking familiar like what I used in school.

I think I find a way I will try it out in a while as toddler now wants attention.

Ok.. back to the drawing board. I tried the debug thing and the cin.get(); and it still flashes off. Now off to learn the Window Console.
May 30 '08 #8
curls8
24
I just tried the cin.get(); again, and it leaves the window open. I guess I did something wrong in the beginning. so I guess I will just use that for now.
May 30 '08 #9
janders468
112 Expert 100+
If you want the console window to stay open then add a line of code that says system("Pause");
Should hold it open for you, I believe this only works in windows, just in case you were to try it on another os, I could be wrong though.
May 30 '08 #10
Ganon11
3,652 Expert 2GB
Adding system("pause") as the last line before "return 0" in main() has been my standard solution when faced with this problem.

Ideally, you would compile your program using Dev, but then get to your program using DOS and run it that way. Then the program would run, the output would be generated, and control would return to you - without ever closing the window.
May 30 '08 #11
curls8
24
Thanks everyone, it did help.
May 31 '08 #12
Sick0Fant
121 100+
Thanks, I just downloading Dev-C++. I just tried to make a simple Hello World, it compile find, but when I tell it to Run a small black screen just flashes and that is it, I am not seeing my program excute. Do you happen to know what is wrong?
I used to like to put in a scanf at the very end, so that it would stay until I hit ctrl+c. :-)
May 31 '08 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: madhu.mys | last post by:
Which C++ compiler do you use for Windows and why ?
25
by: Mohd Hanafiah Abdullah | last post by:
Axiomatic Solutions Sdn Bhd announces the availability of AMPC version 1.2. You can purchase AMPC online now at: http://www.axiomsol.com/hedesu/shopping/index.php Major Changes -------------...
7
by: Tao Wang | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I saw cuj's conformance roundup, but the result is quite old. I think many people like me want to know newer c++ standard conformance test...
10
by: Ardhendu Nandan | last post by:
I am trying to compile Gcc compiler in Windows O/S.I have downloaded entire source Code of this compiler at tries to run it in DEVCPP but I am gating some linker error and some header files missing...
14
by: joshc | last post by:
I'm writing some C to be used in an embedded environment and the code needs to be optimized. I have a question about optimizing compilers in general. I'm using GCC for the workstation and Diab...
4
by: Today's Mulan | last post by:
I guess this is new, at least to people who don't know about this, like me, please be prepared to give me a satifying answer, so please tell me how the compiler "knows" variable "i" as in a...
30
by: lovecreatesbea... | last post by:
K&R says the following in the preface to the first edition, "... the C compiler, and ... are written in C." I'm wondering, does it say even the first / original C compiler was written in C?
5
by: hyderabadblues | last post by:
Following is an abstract of my code Compiler is giving me an error at funciton call func1 as argument of type void * is not compatible with parameter of type VP typedef void * VP; struct name...
41
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
27
by: Dave | last post by:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU compilers. I then decided to try to use Sun's compiler. The Sun Studio 12 compiler reports the following code, which is in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.