Thread: Newbie needs help, compiler won't compile

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    15

    Newbie needs help, compiler won't compile

    First off, I have next to no experience in C++ (although I know BASIC). I do all my programming offline on a computer with Windows ME, due to restrictions brought about by family (I'm 17). Because I use a Legacy OS, CodeBlocks won't work, so I use Dev-C++. But it won't compile my programs.

    I wrote a basic "Hello World" program:
    Code:
    #include <iostream>
    using namespace std;
    
    int main ()
    {
        cout << "Hello World!";
        wait;
        return 0;
    }
    *Note: Even if there is something wrong w/ my program, my problem still happens even when I use Dev-C++'s example programs.

    When I click compile, it opens a file dialog. I'm assuming it wants me to save my script, yes? After I save, the compiling window opens and it waits for a few seconds, but before it makes any progress, I get the following error message (word for word):

    The LIBGMPXX-4.DLL file is
    linked to missing export MSVCRT.DLL:___lc_codepage_func.

    I hate those words. I've seen them so often, I could quote them from memory.

    Can someone either explain this or give me a free version of XP so I can use CodeBlocks?
    PS I also found the ANSI version of Notepad++, so if someone could show me how to install some sort of compiler plug-in, that would work too.
    PPS Sorry I'm so long-winded

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Code:
    #include <iostream>
    using namespace std;
    
    int main ()
    {
        cout << "Hello World!";
        wait;
        return 0;
    }
    Get rid of the wait; line.

    Can someone either explain this or give me a free version of XP so I can use CodeBlocks?
    Here, Home | Ubuntu

  3. #3
    Registered User
    Join Date
    Jul 2012
    Posts
    15
    Still, even when I use the example programs, I run into the same problem.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by future_engineer View Post
    Can someone either explain this or give me a free version of XP so I can use CodeBlocks?
    I'd rather see someone using an up-to-date version if they're going to upgrade anyway...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Jul 2012
    Posts
    15
    wait, what? can you rephrase that?

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    IF you are going to upgrade, why upgrade to XP when Windows 7 is out? XP is over 10 years old.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    > The LIBGMPXX-4.DLL file is
    ...
    > RPM resource mingw32(libgmpxx-4.dll)
    This library is the Windows port of GNU arbitrary precision library.

    Since you're not using any GMP types, nor including any GMP header files, one has to wonder where it's getting the references to this library from?

    Dev-c++ is a pretty buggy in the IDE. Project files just seem to "rot" with the passage of time.
    Have you tried creating a NEW console project, with just that code?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User
    Join Date
    Jul 2012
    Posts
    15
    RE: Salem
    Have you tried creating a NEW console project, with just that code?
    i have no idea what you just said, but in response to that last question you asked: yes, but the problem had slightly different symptoms.

    The error message would appear, however instead of the compiling window closing, the progress bar would continue to grow. but when it was done, i would click "run" and it would say "The source file is not compiled", or something like that.
    *Note: I can't remember for sure, but I think the error message might have said something different when I did this.

  9. #9
    Registered User
    Join Date
    Jul 2012
    Posts
    15
    XP is the most recent software that's compatible with my computer.

  10. #10
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I'm pretty sure 7 will work on XP hardware, too.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #11
    Registered User
    Join Date
    Jul 2012
    Posts
    15
    RE: Elysia
    Not so. I don't know what 7 requires, but Vista needs at least 800 MHz, my computer is 702 MHz. and again:

  12. #12
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by future_engineer View Post
    Not so. I don't know what 7 requires, but Vista needs at least 800 MHz, my computer is 702 MHz. and again:
    If you're sure about that specification, it wouldn't be very useful to upgrade your OS.
    I have a 1.5 GHz netbook which often struggles to run XP and the latest linux distros without problems.
    So, your best bet is to go with an older version like Salem suggested, or some lightweight distribution(which won't be as user friendly as the latest and greatest ); or stay with what you currently have but use commandline tools instead of IDEs.

  13. #13
    Registered User
    Join Date
    Jul 2012
    Posts
    15
    bad news. my dad is one of those technophobic old-timers, and once he heard that i was going to "replace the operating system" he starts freaking out. He probably thinks i'm going to take apart the computer or something. so, although i'm impressed by linux software, for now, it's a no go on the ubuntu.
    i'm getting really sick of these suffocating constraints i'm under

  14. #14
    Registered User
    Join Date
    Jul 2012
    Posts
    15
    it seems my only option is notepad++. i found an ANSI version that will work on my computer. all i need is a debugger and compiler to go with it.
    turn-by-turn directions, please.

  15. #15
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    I think I might go for a re-install of dev-c++.

    Re: XP
    windows xp coa | eBay
    If you're prepared to wait a while, you might be able to get a cheap copy of XP with a good (not used) COA.

    Re: Ubuntu
    But if your hardware is capable of running XP, then I second manasij7479.
    Download Ubuntu 10.04.4 LTS (Lucid Lynx) (it's an older version, not so dependent on the latest hardware, like 12.04 is)
    Burn an ISO, and then reboot and choose the "try ubuntu" option which just runs from the CD.

    It's a good idea to make a really good backup of your windows machine at this point, if you're contemplating some kind of OS upgrade.
    A useful thing to do is buy a second hard disk of a similar size to the one you have; you should be able to pick up something pretty decent (tested and wiped) for say $30 or less.
    You can then freely install XP/Ubuntu/anything else on a separate disk and dual-boot your machine.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help newbie compile program!
    By candysandra88 in forum C Programming
    Replies: 7
    Last Post: 12-13-2008, 11:27 PM
  2. Have no idea how to compile c++, please help (newbie qn)
    By rholloway in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2008, 08:31 AM
  3. Replies: 14
    Last Post: 12-07-2006, 03:19 AM
  4. Can't compile on the other compiler
    By AProg in forum C Programming
    Replies: 8
    Last Post: 05-25-2003, 07:55 AM
  5. Won't compile, can YOU compile it on your compiler?
    By incognito in forum C++ Programming
    Replies: 12
    Last Post: 03-10-2002, 12:00 PM