|
-
July 26th, 2010, 07:43 AM
#1
Question about C++, compilers
Ok firstly may someone tell me what exactly is MinGW? It's based off GCC which is a compiler?
And Borland would be another compiler?
After having trouble setting up qt, I decided to uninstall it along with code::blocks.
I installed mingw, which i suspect you compile program from your windows CMD? And I should have a 'make' command? Would this be correct?
Because I keep getting 'make' is not recognized as in internal or external command...
Change my enviorment varible PATH? I added C:\MinGW and still get the same error...
Lastly Visual C++ is just C++ written with mircosoft's visual studio? So why do we have a dedicated category for it? It's the same C++ code written with a standard notepad is it not??
Any help getting me on the right track with all this would be really appreciated.
-
July 26th, 2010, 08:04 AM
#2
Re: Question about C++, compilers
MinGW is a minimalist GCC compiler for Windows yes, Borland is another. They adhere to the C++ standard, but also have their own functionality as well.
Writing C++ on Windows is hell, Windows does not have a make command. You can either download a UNIX shell like Cygwin, or you can use cmake, however, cmake is not compatible with regular makefiles.
Visual C++ is standard C++, but it has extra stuff for Windows. There is an separate forum here because most of the questions in there deal with using the Windows API, not necessarily the C++ compiler. I can't speak for everyone, but I think most of us in here use GCC on unix or linux.
-
July 26th, 2010, 08:19 AM
#3
Re: Question about C++, compilers
Ok I got the mingw thing. So how would you compile programs using mingw and windows?
And by extra stuff you mean extra libraries, functions?
Talking about Unix... It's still available? People still use it? LoL sorry for sounding like a noob... But was'nt UNIX a operating system for 'mainframes' back in the day?
-
July 26th, 2010, 08:35 AM
#4
Re: Question about C++, compilers
 Originally Posted by ninja9578
or you can use cmake, however, cmake is not compatible with regular makefiles.
Well, it is, but you may be misunderstanding CMake. Not that I'm an expert or anything, but after playing around with it, CMake seems to be a tool for generating build files----its output can be Makefiles, VS projects, etc.
 Originally Posted by Chris Evil
Ok I got the mingw thing. So how would you compile programs using mingw and windows?
You could use Cygwin, which adds a Unix-like command-line to Windows (distinct from the DOS-like command window that you normally have). I'm not sure if MinGW works outside of Cygwin or not.
 Originally Posted by Chris Evil
And by extra stuff you mean extra libraries, functions?
Every compiler has its own little extensions and quirks----things it will support that others don't. A particular function, a particular syntax, etc. I actually think this is a problem, since it encourages non-standard coding.
Talking about Unix... It's still available? People still use it? LoL sorry for sounding like a noob... But was'nt UNIX a operating system for 'mainframes' back in the day?
When people refer to Unix, they're usually talking about "unix-like" systems such as Linux or Solaris. There are a lot of specific variations, but they all have underlying commonalities from the Unix core.
-
July 26th, 2010, 08:37 AM
#5
Re: Question about C++, compilers
Use Code::Blocks, it's nicely integrated with MinGW, you can even install them together.
No, VC++ has extra functions and types and all sorts of stuff. All compilers offer some compiler-specific features. In VC++, you can do this:
Code:
for (unsigned int i = 0; i < 15; ++i){
//something
}
cout << i << endl; //in all other compilers, i is not in scope
This technically means that VC++ shouldn't even be able to call itself C++, as it violates the standard, but I think they made this kind of behavior optional recently.
UNIX is by a wide margin the dominate operating system. People tend to forget that PCs take up a small amount of all of the computing that's done. Almost all phones, calculators, servers, medical devices, guidance systems... have either unix or Linux under the hood. Mac OSX is UNIX, and Linux is based off of UNIX.
Last edited by ninja9578; July 26th, 2010 at 08:40 AM.
-
July 26th, 2010, 08:37 AM
#6
Re: Question about C++, compilers
 Originally Posted by Lindley
When people refer to Unix, they're usually talking about "unix-like" systems such as Linux or Solaris. There are a lot of specific variations, but they all have underlying commonalities from the Unix core.
If I remember correctly, Solaris is BSD UNIX.
-
July 26th, 2010, 09:00 AM
#7
Re: Question about C++, compilers
 Originally Posted by ninja9578
In VC++, you can do this:
Code:
for (unsigned int i = 0; i < 15; ++i){
//something
}
cout << i << endl; //in all other compilers, i is not in scope
I'm fairly certain that bit of weirdness was confined to VS 6.
-
July 26th, 2010, 09:03 AM
#8
Re: Question about C++, compilers
Lastly Visual C++ is just C++ written with mircosoft's visual studio? So why do we have a dedicated category for it? It's the same C++ code written with a standard notepad is it not??
MSVC is by far the most popular compiler for the windows platform, and windows is the most used OS out there.
In other words, a lot of people are using MSVC, and most of them are doing stuff that's specific to windows. It just makes sense to have a separate category for them.
This technically means that VC++ shouldn't even be able to call itself C++, as it violates the standard, but I think they made this kind of behavior optional recently.
I'm sure this has been fixed since at least MSVC8 (2005). It definitely doesn't work with MSVC10 (2010), even with language extensions enabled.
-
July 26th, 2010, 09:04 AM
#9
Re: Question about C++, compilers
Yeah I've been reading about this whole linux/unix/unix-like/gnu, doing my head in but oh well..
MinGW is a port of the GCC for windows (right?), so I still need cygwin? Is that what code::blocks would using or?...
Where do I go to from here? Use code::blocks? But what about the qt/mingw 'make' command error?
Thanks guys..
-
July 26th, 2010, 09:18 AM
#10
Re: Question about C++, compilers
MinGW and Borland (and Visual Studio) firstly are so-called IDE's (Integrated Developer Environment) what means there is one program (studio) with a source-code editor, a compiler, a project tree, a debugger, multiple wizards for code generation and some more tools where you can edit, build and run new projects. The point of an IDE is that you can do all things necessary for (normal) development from this one application.
While Borland (and VS) have their own C++ compiler, MinGW uses one of the GNU compilers mostly gcc and because those are based on makefiles MinGW is based on makefiles as well but can support you to change those makefiles interactively.
Other IDE's mostly have their own (proprietary) project files which may or may not be similar to makefiles. For example VC compiler was based on a projectfile format similar to a makefile until VC6 (1998) and changed to a XML projectfile for later versions.
qt also has an IDE (afaik it uses gcc compiler) but it also has Add-Ins for other IDE's so that you can use the resource editor and wizards of qt but make the builds using the 'normal' IDE's.
If you had trouble setting up qt, it normally isn't a good idea to try another IDE where the hurdles for a beginner are even higher than with qt. For example in MinGW you hardly can succeed if you don't know how makefiles work and what you have to change in those makefiles when you get a linker error. In qt IDE (same as in VS and Borland) you wouldn't much care for project files yourself but mostly let do the IDE for you (note, that assertment must not be true for all projects). Moreover, with qt, VS and Borland you can develop GUI programs while the MinGW (also CygWin and some other) firstly offer support for console and server applications.
Regards, Alex
-
July 26th, 2010, 09:34 AM
#11
Re: Question about C++, compilers
MinGW is a port of the GCC for windows (right?), so I still need cygwin? Is that what code::blocks would using or?...
Where do I go to from here? Use code::blocks? But what about the qt/mingw 'make' command error?
If you're on Windows and just learning I would recommend using MSVC. The Express version is available for free or if you're eligible for academic purchases you can get the Pro edition free via Dreamspark.
-
July 26th, 2010, 09:35 AM
#12
Re: Question about C++, compilers
One thing which may be helpful to understand is the nature of a project/makefile: Basically, such a thing is merely a file specifying the arguments to be passed to the compiler and linker in order to build all the source code.
-
July 26th, 2010, 09:58 AM
#13
Re: Question about C++, compilers
Ok so standalone minGW is for the more advanced user?
Secondly to understand the nature of project files I'll try read up on that thank you ... Apart from what they are, is there no 'native' make command for windows? So are you not mean/encouraged to compile C++ files with windows?
How should I go about compiling C++ files meant for QT?
-
July 26th, 2010, 10:32 AM
#14
Re: Question about C++, compilers
 Originally Posted by Chris Evil
Ok so standalone minGW is for the more advanced user?
I'd say that MinGW is intended to allow Windows users to more easily build things that were originally written for Unix-like systems.
Apart from what they are, is there no 'native' make command for windows? So are you not mean/encouraged to compile C++ files with windows?
I'm not sure what you mean by that. The most commonly used build tool on Windows is Microsoft Visual Studio. Technically this means most people use the Microsoft Compiler, but almost no one invokes it directly on the command line, preferring to go through the IDE.
How should I go about compiling C++ files meant for QT?
QT is a library. All you have to do is set up your project or Makefile to properly know where the QT headers and libraries are, and link it in appropriately during the build.
-
July 26th, 2010, 12:04 PM
#15
Re: Question about C++, compilers
Mingw and Cygwin are not the same when using them. One brings unix tools to windows to build native applications and the other brings the unix environment to windows so your unix apps can run on windows. I would guess mingw is constructed from cygwin, but I wouldn't know. This explains the difference http://www.mingw.org/node/21.
Mingw is not an ide. Cygwin is not an ide.
Mingw is basically gcc with a Bourne Shell interpreter http://www.mingw.org/wiki/MSYS. Your code does not run in this interpreter. your code runs native as a win32 app.
Cygwin is a unix-like environment. Your code runs in this environment.
In short ..
Mingw = build native apps for windows
Cygwin = compile and run unix-like apps on windows.
Code::Blocks is an ide. It can use many compilers. Code::Blocks is cross-platform. Code::Blocks can use gcc, vc++ compiler, mingw( gcc on windows ) and so forth.
You can code with mingw to create win32 apps.
I haven't really used Qt, but I am sure you can use it with Code::Blocks with Mingw since Qt is cross-platform. You need to download the framework and tell code::blocks where this framework is.
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|