Menu

I am new to C++ and can not get stuff to run

eagle11
2007-10-24
2012-09-26
  • eagle11

    eagle11 - 2007-10-24

    I have tried running several short programs including the Hello World program included in the help file and I can not get them to run....The hello world program looks like it just pops up a screen for a brief moment but it does not stay up. can anyone help me?

     
    • Anonymous

      Anonymous - 2007-10-24

      The answer to your problem is in the thread titled "PLEASE READ BEFORE POSTING A QUESTION" on this forum. This thread also explains what you need to include in a post when you have a real problem.

      What is happening is that when an application terminates, the operating system closes its window. This is normal behaviour for all programs but everyone seems strangely surprised when it happens to their own programs. Actually that is unfair - most other IDEs execute programs under development as a child process of a a wrapper to prevent the window from closing; so Dev's behaviour though normal, is unexpected.

      Please please do not pay any attention to any examples in the Dev-C++ help file it is a pile of pooh.

      To get a "hello world" example that will behave as you expect do: File->New->Project..., select the "Introduction" tab and then teh "Hello world" project. Select C or C++ as your projects language, give it a name, and click OK. That will get you off to a better start that the help file so called "tutorial". When you want to create your own code, you can use the Console Application template on the Basic tab (or any of the other project templates when you are ready).

      I would recommend always using a project even though Dev-C++ allows single file applications to be built without one. A project retains the tool chain settings so your build is always reproducible.

      Clifford

       
    • Osito

      Osito - 2007-10-24

      Did you try the "Hello" project in the examples folder? Open up Hello.dev and click Compile and Run. It's not terribly exciting but it will test that your installation is OK.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.