Jump to content
  • Advertisement
Sign in to follow this  
LordofMuffins

So I just downloaded Dev C++ Beta 5...major help

This topic is 5472 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using a Micron 1998 (my newer computer isn't working at the moment) and just downloaded this compiler. Keep in mind this is one of my first programs...so I'm learning from a visual C++ book, and put in the basic line of code minus the void of course, to make it compatible. So it compiles and I decide to execute it...of course something always has to go wrong with this piece of crap. So the compiler window minimizes itself and I see a ms-dos screen where my compiled program should be but instead nothing appears and the compiler maximizes itself. And then the ms-dos screen dissapears. I've done this plenty of times and it does the same thing. Is there some setting I have to turn on? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
It's working correctly.

The program is starting (black box appears), running, and terminating (black box disappears).

put system("pause"); at the end of main and add #include <cstdlib> at the top (I think cstdlib will get 'system', if not use iostream)

Share this post


Link to post
Share on other sites
You can setup a tool to run programs so that it won't dissappear.

cmd /K (program)

There's a special code for the name of the program but I don't remember what it is, and I don't feel like installing it to find out.

Share this post


Link to post
Share on other sites
Also, does anyone else run this compiler? It's weird. It only compiles when I don't put pound signs next to include...what's up with that? Does it have to do with the fact that the book is Visual c++? (keep in mind I'm removing the void)

Share this post


Link to post
Share on other sites
Quote:
Original post by LordofMuffins
Also, does anyone else run this compiler? It's weird. It only compiles when I don't put pound signs next to include...what's up with that? Does it have to do with the fact that the book is Visual c++? (keep in mind I'm removing the void)


show an example of what you're talking about. it shouldn't allow you to just:


include <windows.h>




or whatever.


Quote:
Original post by LordofMuffins
So I have to do this with every program? Or can I add it to a header or something? Sorry, I'm new to coding. What if I do this with a game? What do I do then?


what you are building is called a "console" program and is meant to be run from the console not by double-clicking it. that's why it "acts wierd". if you run it through the console window DOS style it'll look much happier.

-me

Share this post


Link to post
Share on other sites
...Uhh...pound signs next to include but you're removing the void? What...what the hell are you TALKING about? NICK NO UNDERSTAND. BRAIN HURT. FEEL...THE EUROMINT.

Share this post


Link to post
Share on other sites
If something compiles when you do this:
include <stdio.h>

but does not compile when you do this:
#include <stdio.h>

then it's not a C/C++ compiler. The pound signs are required for preprocessor directives in the language.

I believe you can (still) download the free command-line compiler and linker for VC++ from Microsoft. You don't get the nice integrated environment with debugger, but you do get a working compiler that's probably much closer to that book of yours.

To compile "foo.cpp" and run it as "foo.exe" in the command window, assuming that compiler is in your path, you do:
C:\myproject> cl foo.cpp
compilation status goes here
C:\myproject> foo.exe

Share this post


Link to post
Share on other sites
It does. It only compiles when I put, for example:

include <iostream.h>

It won't work with:

#include <iostream.h>

When it doesn't compile (when I use the above line of code) it says it's on line 6, but I can't find anything wrong with line 6! Then I erase the # and it compiles. WTF? Is it my OS? This is a really old and easily crashable computer. I really want to know how to view my programs as well. I'm thinking about getting http://www.amazon.com/exec/obidos/tg/detail/-/1931841098/qid=1096405112/sr=8-1/ref=pd_csp_1/002-8255526-7521632?v=glance&s=books&n=507846 <---- this book, does anyone know if it comes with a C++ compiler?

Edit: Thanks hplus :-)

Share this post


Link to post
Share on other sites
please just post your code. there's probably something else wrong with it that's making it bizarro like this. use [*source] [/source] tags (without the asterix to wrap your code so it looks pretty.

-me

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!