Thread: Dev-Bloodshed. Please help!

  1. #1
    Registered User Kuplex's Avatar
    Join Date
    Dec 2001
    Posts
    18

    Question Dev-Bloodshed. Please help!

    I'm using the Dev-Bloodshed compiler and I have a few questions:

    1) Why won't the dos window stay open unless I put in a
    system("PAUSE"); before return 0;? Is there a way to prevent
    it from closing without an automatic "press any key to
    continue" prompt like MSV6?

    2) How do I get it to link correctly with other files? It works in a
    MSV6 workspace, but not in this one. See, I;ve made another
    C++ file to hold a quick clear screen command, gotoxy
    command for coord., and a color function for the text and bg.
    In, MSV6, they link correctly, but in Bloodshed, I just get
    'unreference variable' and other such errors. Am I doing
    something wrong?
    Kuplex
    "The only thing you can count on is uncertainty."

    Must I explain myself futher?

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    6
    I had the same problem. I just ran the program from a DOS prompt and it worked fine.

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    5

    Smile DEV-BLOODSHED

    Hello, I use this type of complier. You have to add two thing to your programs. Here it is:
    #include <iostream.h>
    #include <stdlib.h> (THIS IS ONE OF THEM)

    int main()
    {

    system("PAUSE"); (THIS IS THE OTHER ONE)
    }
    This two lines have to be but in every program that you create using Dev. This is only for DEV. fter you add this lines your dos window should stay put.
    Bye

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    162
    There are two different MS-DOS type programs. One is command.com, which stays open until you close it, and the other is conagent.exe, which is the WIN-32 console that 'con's the MS-Dos prompt so you can run DOS programs, but it is really run by Windows. When you open a program through conagent it starts up and then shuts down when the program quits. That is what is default when you call an exe file that is not WIN32 API stuff. I don't know of any way to change this, but you can always start your programs in command.com.

  5. #5
    Registered User Kuplex's Avatar
    Join Date
    Dec 2001
    Posts
    18

    Thumbs up Thanks

    I guess its just one of those things that I must deal with in order to enjoy a free compiler.
    Kuplex
    "The only thing you can count on is uncertainty."

    Must I explain myself futher?

  6. #6
    Registered User
    Join Date
    Dec 2001
    Posts
    88
    NOOO!!
    you're wrong!

    if it stays open or not depends on the system settings!
    rightclick the command.com and look your an option like 'close at ending' (I have a german version so i don't know how it's called in the english version)

    every compiler that generates a console programm has the deal with this - even if you pay a hundred million dollar

    and please don't use system("PAUSE") please use getchar() or cin.get()

    because system("PAUSE") makes your program unportbale - in Unix Systems this command will not work - so beware of that and use the C/C++ Standard...
    Hope you don't mind my bad english, I'm Austrian!

  7. #7
    Unregistered
    Guest

    Post Dev BLoodshed

    Greetings,

    Fisrt I want to state that I'm new to C++ and DEV, but I put a loop in my program to keep the window open. I don't have
    system("PAUSE"); anywhere in my program.

    But beware to get getch(); to work you have to include conio.c

    #include <iostream.h>
    #include <conio.h>
    #include <conio.c>

    int main();
    {
    cout << " Hello World";

    getch();

    return 0;
    }

    I hope that helps

    Warduke

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bloodshed Dev Stops Compiling
    By bengreenwood in forum C++ Programming
    Replies: 4
    Last Post: 11-11-2007, 03:25 PM
  2. bloodshed dev c++ help
    By rocketmanx in forum Game Programming
    Replies: 4
    Last Post: 07-28-2004, 02:57 AM
  3. Sleep on Bloodshed Dev C++
    By BigSter in forum C++ Programming
    Replies: 3
    Last Post: 11-15-2001, 10:17 AM
  4. Wait on Bloodshed Dev C++
    By BigSter in forum C++ Programming
    Replies: 1
    Last Post: 11-14-2001, 03:46 AM
  5. Tutorial about Bloodshed Dev!
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 11-13-2001, 07:42 PM