Author Topic: What compiler?  (Read 7081 times)

FDS

  • Guest
What compiler?
« on: 21 September 2005, 20:37:14 »
Hello all.

I am starting to learn C and C++.
The only thing that I created are some DOS programs that say funny things. :(

Thanks for any help.
« Last Edit: 1 January 1970, 00:00:00 by FDS »

Speedator

  • Guest
(No subject)
« Reply #1 on: 22 September 2005, 08:30:05 »
Well, Dev-C++ uses Mingw to compile. And Mingw is based on gcc.
But I am wondering about this functions. It is not ANSI-code.
As I remember those seem to be Borland-specific C-functions for DOS.
But I am not sure. I try to find something about it, this evening.
You should learn C/C++ by the ANSI-standard. Gcc is mostly conform with ANSI. Borland and MS Visual C++ have special, propietary functions, which do not work with each other compiler.
« Last Edit: 1 January 1970, 00:00:00 by Speedator »

EineTasseKaffee

  • Guest
(No subject)
« Reply #2 on: 22 September 2005, 17:40:43 »
Yeah, Speedator is right.
There was a delay() (and clrscr(), too) function in Pascal languages like Turbo Pascal, but it's not part of ANSI C/C++. Maybe it's part of MS Visual C++, or Borlands compiler like said by Speedator.

Quote
I am starting to learn C and C++.

So you may be very unexperienced (we all were at the beginning), so here is a possible explanation

A "delay()" function used in a c/c++ code sample may be defined in another code sample by the author of this sample or may be just used as a "symbol" that a delaying function is needed.
In Germany we call that "Pseudo-Code": It's a description of the work the code have to do, but not of the code itself. This way a program can be described without using a programming language, so the description can be understood by any programmer and easyly be implemented in C or any other programming language.
E.g.:
The "Pseudo-Code" of smooking can be descripted as:

Take(Cigar);
Take(Fire);
Burn(Cigar, Fire);
WHILE(Cigar burning) DO {
  Bite(Cigar, not_burning_end);
  Fill(Lungs,Smooke);
  Stop_Biting(Cigar);
  Fill(Lungs, Air);
}

You may find something like this published as code-sample, but its not really a code sample, its unable to compile not matter the IDE you are using.

I started programming with C++ 1 year ago.
A website which helped me a lot is:

www.robsite.de

It's german.
But it is a collection of many tutorials, not only german ones but english ones, too.
I'm sure you will find a good tutorial there.

I'm using Dev-C++ by myself, its great and its free (and its great because its free).[/quote]
« Last Edit: 1 January 1970, 00:00:00 by EineTasseKaffee »

FDS

  • Guest
(No subject)
« Reply #3 on: 22 September 2005, 18:01:11 »
Thanks for the help.

So...what program should I use ?
« Last Edit: 1 January 1970, 00:00:00 by FDS »

Speedator

  • Guest
(No subject)
« Reply #4 on: 22 September 2005, 20:54:48 »
Yes, stay at Dev-C++/GCC and it is the best way of learning ANSI C/C++, which makes you more platform/enviroment-independent. And you can generally compile you code on almost every system.
And the functions are not very spreaded(like some VSC++-funcs, maybe).
So there is no reason to abide by those.

BTW: There is no "modern" IDE for djgpp, only RHIDE for dos.
« Last Edit: 1 January 1970, 00:00:00 by Speedator »

FDS

  • Guest
(No subject)
« Reply #5 on: 22 September 2005, 21:15:57 »
Is there a good compilator in grafic mode like Dev-C++?
Because Turbo C and DJGPP are DOS like.

And...more one thing:
Where can I find a good tutorial or list of commands to create Windows like "windows" with button and images?
« Last Edit: 1 January 1970, 00:00:00 by FDS »

EineTasseKaffee

  • Guest
(No subject)
« Reply #6 on: 23 September 2005, 02:41:29 »
Hi, its me again.
This "Guest" is me, too.

Quote
Is there a good compilator in grafic mode like Dev-C++?
Because Turbo C and DJGPP are DOS like.

Every compiler is "DOS like".
The grafic mode things are IDEs (Integrated Developement Enviroments)
and an IDE is using a "DOS like" compiler itself to compile the source.
But the IDE hides the compiler, and its much more comfortable to use an IDE.
You can tell Dev-C++ to use another compiler, if you want.
Check out the Dev-C++ help for this (yeah i know the help is not finished yet, but this specific help topic is finished ).
The Dev-C++ does much more for you than using the compiler, check out the package manager, it's great.

Quote
Where can I find a good tutorial or list of commands to create Windows like "windows" with button and images?


Do this in Dev-C++:

File-->New-->Project-->Windows Application.

It creates a ready-to-compile-program which does an empty grey window.
The window works like every Windows window, you can resize, move, .........., close it.

The source code is commented.

But you will need to learn the C++ basics before you will UNDERSTAND how to create windows and buttons.
Searching the web for a basic C++ tutorial in your own language is the best idea.
The second best is to search for a english one, you will find maybe 1200000 english ones......

By the way: I created my first window using SDL, not using the "regular" ways to create windows and that was a good idea, because SDL can do anything i wanted to do and is much easier to use.
If you want to use images, SDL maybe is the right choice for you, too.
You can download a package for Dev-C++ to use SDL.
There are some great SDL tutorials at the SDL homepage and some other great SDL tuts somewhere in the web.
« Last Edit: 1 January 1970, 00:00:00 by EineTasseKaffee »

Speedator

  • Guest
(No subject)
« Reply #7 on: 23 September 2005, 08:01:04 »
Why don't  you use Dev-C++?
Do you want to insist on you functions?
I really think Dev-C++ is the best solution, if you want to learn C/C++.
But you can also use the Borland Compiler for (version 5.5):
http://community.borland.com/article/0, ... 33,00.html
But I do not think it is the best decision.
And yes, SDL is a solution, but maybe GTK+ and QT, WxWidgets, too.
What do you want to do FDS? Games or "ordinary" programs?
BTW: I think it is better to learn more about C/C++ for a long time until you work with a GUI(means in "window-mode").
« Last Edit: 1 January 1970, 00:00:00 by Speedator »

FDS

  • Guest
(No subject)
« Reply #8 on: 24 September 2005, 02:23:09 »
Thanks for the help.

I will keep the Dev-C++.
And...I would like to create some simple games with images and sounds.
I only know the basic basic basic commands, like "if", "cout", "cin"...

Do you think I should stay with DOS for more time?

....and....What is "SDL"?
« Last Edit: 1 January 1970, 00:00:00 by FDS »

EineTasseKaffee

  • Guest
(No subject)
« Reply #9 on: 24 September 2005, 05:29:40 »
The SDL homepage:

www.libsdl.org

SDL is great for simple games.
But:
Quote
BTW: I think it is better to learn more about C/C++ for a long time until you work with a GUI

Thats right and very important, it's THE WAY to learn all the tools  C++ brings (like objects).
If you don't know an axe, you have to cut wood with a hammer.
So watch all your tools before starting bigger work.


But it's ok to crush a small piece of wood with a hammer.
« Last Edit: 1 January 1970, 00:00:00 by EineTasseKaffee »

FDS

  • Guest
(No subject)
« Reply #10 on: 25 September 2005, 01:36:45 »
Thanks again!

Do you think I should use Dev-C++ with another compiler? :confused:
One that uses ANSI C?
« Last Edit: 1 January 1970, 00:00:00 by FDS »

Speedator

  • Guest
(No subject)
« Reply #11 on: 25 September 2005, 17:14:27 »
Why you want another compiler?
I think you won't find many free compiler except gcc(or his windows-port MinGW, that is used by Dev-C++), which are so powerful and support ANSI C/C++ relativly good.  Maybe Cygwin, oh it's gcc, too ;).
Is there anyone who has experience with Intel C & C++ Compilers under Dev-C++?
« Last Edit: 1 January 1970, 00:00:00 by Speedator »

FDS

  • Guest
(No subject)
« Reply #12 on: 25 September 2005, 18:39:49 »
Someone said me that I should use ANSI C/C++. If not I would have big problems. :confused:
Is Dev-C++ useing ANSI C/C++? Because it doesn't understand commands like delay() and cprinf().
« Last Edit: 1 January 1970, 00:00:00 by FDS »

Speedator

  • Guest
(No subject)
« Reply #13 on: 26 September 2005, 07:43:20 »
ANSI C/C++ are standardized version of the c/c++ language, which are made by the American National Standards Institute.
The compilers should stay to this standard, but mostly there are more or less  big parts that vary.
But the compile MinGW(the compiler which is based on GCC and comes with Dev-C++) is relativly near to the ANSI standard.
« Last Edit: 1 January 1970, 00:00:00 by Speedator »

FDS

  • Guest
-
« Reply #14 on: 26 September 2005, 19:01:22 »
Ok then! I will keep DEV-C++! :O
Thanks!
« Last Edit: 19 June 2016, 06:18:16 by filux »

 

anything