C++ compiler needed (free is nice

  • Context: C/C++ 
  • Thread starter Thread starter Saladsamurai
  • Start date Start date
  • Tags Tags
    C++ Compiler
Click For Summary

Discussion Overview

The discussion revolves around finding a suitable free C++ compiler for a university programming course. Participants explore various options, including IDEs and compatibility with Microsoft Visual C++ 6.0, while addressing the challenges faced by a beginner in programming.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related
  • Debate/contested

Main Points Raised

  • One participant inquires about free C++ compilers that operate similarly to MS Visual C++ 6.0 and allow for saving and opening projects in MS Visual.
  • Another participant suggests the Express edition of Microsoft Visual Studio as a free option, noting it is similar to the professional version but lacks some optimizations.
  • GCC compiler for Windows is mentioned as an alternative, with a recommendation for using Eclipse as an IDE.
  • Concerns are raised about compatibility issues between Visual C++ 6.0 and newer versions, particularly regarding project imports.
  • Dev C++ is proposed as another complete IDE option for C++ programming.
  • Participants discuss difficulties in executing programs in Visual Studio Express, with suggestions for using specific commands to run programs.
  • One participant expresses confusion about project setup and executable creation, leading to further technical guidance from others.
  • There is a discussion about building applications versus DLLs, with clarification provided on how to set project properties correctly.
  • Participants share insights on using the command line compiler for simple programs as an alternative to the IDE.

Areas of Agreement / Disagreement

There is no consensus on a single best solution, as participants present multiple options and experiences with different compilers and IDEs. Some express satisfaction with the Express edition, while others highlight potential issues with older versions of Visual C++.

Contextual Notes

Participants express varying levels of familiarity with programming environments, leading to discussions about project configurations and executable settings. There are unresolved questions about the best practices for beginners in setting up their development environment.

Who May Find This Useful

Beginners in programming, particularly those taking introductory courses in C++, may find this discussion helpful for navigating compiler options and troubleshooting common issues in IDEs.

Saladsamurai
Messages
3,009
Reaction score
7
C++ compiler needed (free is nice:)

So I am taking a very basic (no pun) programming course at my university. We are working in C++ for now and we use Microsoft Visual Basic C++ 6.0 (or something to that effect).

I live waayyy off campus, so I would like to be able to work at home if necessary as opposed to hanging out all day in the computer lab.

Is there a C++ compiler that is:

a) free

b) Operates in the same exact way as MS Visual

c) Will allow me to save a program and then open it with MS Visual

?

Sorry if these are silly questions, but this is my first experience with programming.

Casey
 
Technology news on Phys.org


The express edition of Microsoft Visual studio is free (all languages) http://www.microsoft.com/express/vc/

The compiler doesn't do all the performance optomisations of the pro one but is otherwise identical, you have to manually download some extra SDKs to do certain kinds of windows programming but for general learning C++ it is great.

There is also the excellent GCC compiler for windows http://www.mingw.org/
But if you want an IDE you will need to something like eclipse http://www.eclipse.org/
 
Last edited by a moderator:


Note that the interplay of Visual C++ 6.0 with the current version of Visual C++ is sub optimal. In particular, since VC++ 6.0 was such a dog you may find that VC++ 2008 sometimes has problems importing projects generated with VC++ 6.0. Moreover, if you find yourself doing anything vaguely related to technical/scientific computing with VC++ 6.0, get ready to learn an awful lot about pragmas...

You might find it worth your while having a word with whoever's giving your class and telling them that the current (Express) version of Visual C++ is both free and much, much better than VC++ 6.0. It would make an awful lot more sense to give a class based on the newer, better version than a ten year old piece of crap.
 


dev c++ is another one you might be interested in, its a complete IDE like visual studio.
 


mgb_phys said:
The express edition of Microsoft Visual studio is free (all languages) http://www.microsoft.com/express/vc/

The compiler doesn't do all the performance optomisations of the pro one but is otherwise identical, you have to manually download some extra SDKs to do certain kinds of windows programming but for general learning C++ it is great.

There is also the excellent GCC compiler for windows http://www.mingw.org/
But if you want an IDE you will need to something like eclipse http://www.eclipse.org/

That free MS Visual trial looks perfect! Thanks! I think 90 days should be right on schedule since we then move on to MATLAB.

Thanks for all the input guys :smile:

Casey
 
Last edited by a moderator:


The MS one isn't a trial - if you download the EXPRESS edition it's totally free.
 


Okay... where the HELL is the execute command/button in Visual Express? Am I retarded or something?

I have been looking for like 30 minutes now :smile:
 


F5 / ctrl-F5 ? or debug->start->without debugging
Or at least it is in pro
 


I cannot get it to work. It's weird; I click "start w/out debugging" and a dialogue box appears that asks me to "pick something executable file..." and there is a drop box with only one option.

I did not want to mess with it since it looked like something registry-related.

What happened to a simple red exclamation point?

Also, the "Help" section is a nightmare. I am going to watch a tutorial when I get time.
 
  • #10


Strange. If you have a properly created project (it is called a solution now, or something, I am still thinking in terms of VStudio 6.0) F5 or Ctrl-F5 should either start the program, or ask if you want to make it if there is no up to date exe.

Perhaps you have just opened some source without creating a project?
 
  • #11


In the project setup (project menu->properties or right click on the project in the tree)
Then Configuration properties->Debugging
The 'Command' should be $(TargetPath)
Also check the 'Output file' setting in Linker->General

If it's missing it will ask you for the executable to run.
 
  • #12


Hmm. Still having trouble; sorry, this is my first time with any programming software :smile:

I have my program written in an open project.
I have "built" it and there are zero errors.

That info you told me to check looks like this (I had to put in the "$(TargetPath)") Is it really supposed to say that? Or am I supposed to replace "Target path" with something?:blushing:

debug.jpg

linker.jpg


Now when I hit "Start w/out debugging I get this:
error.jpg


Then I am lost again :smile:

Thanks for your help thus far, I appreciate it!
 
  • #13


You are building a DLL (a shared library) not an executable.

If you want an executable set
Configuration properties->General
Configuration type = Application (.exe)

I'm surprised it let you build a dll with a main() without complaining ?
 
  • #14


Awesome! Thanks so much!

So will I need to change all of that stuff ($(TargetPath)", (Application(.exe))
every time I start a new project?

Or will it default to that from now on?
 
  • #15


It will be filled in automatically.
When you start a new project it asks you if you want to create a console app, windows app, dll etc.
 
  • #16


Okay. My problem is I really just do not know what I am doing.

Here is a really stupid program I just wrote; I am sure there are errors, but that is not important:

#include <iostream>;
using namespace std;

int main()
{
double x1 (1), x2 (2);
y = x2-x1;

count <<"y is " << y;

return (0)
}

Now if I want to open Visual Studio and paste that into an environment where it will work, what is the correct file path?

When I click File-->new project

these are my options:

file.jpg
 
  • #17


Select win32->win32 console project
It will just make a regualr .exe that you can run on the command line (or from visual studio)

It will create an empty project with a file called "name_of_project.cpp" containing just

int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}

You can replace this with the normal main(...) it's just some windows redefines for historical reasons.


CLR is C++ but running ontop of the .Net - a whole level of complexity you want to avoid!
 
  • #18


mgb_phys said:
Select win32->win32 console project
It will just make a regualr .exe that you can run on the command line (or from visual studio)

CLR is C++ but running ontop of the .Net - a whole level of complexity you want to avoid!

:smile: Sorry, but there is win32--> and my options are "Win32 Console Application" or "Win32 Project"

There is no "win32 console project"

Thanks!
 
  • #19


Sorry meant application (was doing it from memory)

new_project.png
 
  • #20


Sweet! Thank you :smile:
 
  • #21


For very simple programs like that you can also just use the command line compiler.
Create "whatever.cpp" in a text editor then in the start menu for visual studio there should be an entry "visual studio 200X command prompt" which will start a dos box with all the correct paths set.
Cd to the the directory with "whatever.cpp" and just type "cl whatever.cpp" it will create "whatever.exe" which you can run by just typing "whatever"
 

Similar threads

Replies
6
Views
3K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
8K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 16 ·
Replies
16
Views
10K