Advertisement

Compiler time now =-)

Started by January 25, 2002 06:52 PM
6 comments, last by Tac-Tics 22 years, 10 months ago
OK, well now that I know a site to help me with my C++, I need to be able to use C++. My school uses a compiler environment called CodeWarrior, but I don''t have any compiler at home. I downloaded a free compiler called Digital Mars but I''m not quite sure how to "compile" my cpp files =-/ I tried to execute it from DOS prompt like I would in Java, but I didn''t quite work. Can someone help me with this? Sorry my question is so very primitive =-| "I''''m not evil... I just use the power of good in evil ways."
I''m just starting myself and I downloaded dev-c++ from
http://www.bloodshed.net/

and with just some minor modifications of the Microsoft code was able to do all the nehe tutorials.
Advertisement
Or ...
http://www.delorie.com/djgpp
http://www.inprise.com

However, Dev-C++ is probably your best bet.
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Ok, I got Dev-C++ compiler... but it''s a little different than what I''m accustom to. At school when I compile something, it just spits out my .exe file. But on this one, it''s got Rscr.rc, rscr.o, and program.o as well as the .exe file. What are those other files for?

And also, I tryed a simple test code like this:

#include <iostream.h>
int main()
{
cout << "Hi there!";
return 0;
}

but it just pops open the window, displays it for a split-second, then closes it and returns to DevC++... What''s with that?

"I''''m not evil... I just use the power of good in evil ways."
When the program ends it closes. Make it not end if you don''t want it to close (or run it from a Win32 Console).

GCC (the compiler behind Dev C++) outputs object files (compiled but not linked files) with a .o extension by default. A .rc file is an uncompiled Win32 resource file (most Win32 compilers use this same extension, so you''ll see it a lot for Win32 applications).

Errgg... this still isn''t working. I''m executing it from DOS prompt, but it still just pauses (flashing Projec~2.exe on the title bar), then returns to the command line. =-/

"I''''m not evil... I just use the power of good in evil ways."
Advertisement
Alrighty, after a few hours of playing around with it (with regular snake and gaming breaks =-) I got it to work a 'little' better. I had to put the program in a loop at the end until a condition was met to keep it from exiting. Then after that, I tryed running it form DOS prompt instead and it worked fine.
Thanks for the help.



Edited by - Tac-Tics on January 25, 2002 10:59:49 PM
This question is asked every single day.

  #include <stdlib.h>.../* your code here */system("PAUSE");return 0;}  


That should make it a bit easier.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[if you have a link proposal, email me.]

[twitter]warrenm[/twitter]

This topic is closed to new replies.

Advertisement