Like Tree2Likes
  • 1 Post By dwks
  • 1 Post By grumpy

new to gcc, need guidance

This is a discussion on new to gcc, need guidance within the C++ Programming forums, part of the General Programming Boards category; Hello, I have downloaded mingw, I'm playing with it to try and learn it from command line, but it is ...

  1. #1
    Registered User
    Join Date
    Mar 2011
    Location
    Baltimore Md. USA
    Posts
    58

    new to gcc, need guidance

    Hello, I have downloaded mingw, I'm playing with it to try and learn it from command line, but it is nothing like Visual studio 10 PE- which is why I want to learn it. anyway, I'm trying to compile a simple hello world program on it and it is giving me these errors, can you help me with their meanings:


    from file z: mingw\bin\..lib/gcc/mingw32/4.5.2/include/c++/bits/postypes.h:42;0,
    from file z: mingw\bin\..lib/gcc/mingw32/4.5.2/include/c++/ios:39, 40,
    from file z: mingw\bin\..lib/gcc/mingw32/4.5.2/include/c++/cwchar:47:19; fatal error: wchar.h: No such file or directory
    complilation terminated

    here is the code
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main ()
    {
    cout<< "hello world, it finally works!"<<endl;
    
    return 0;
    
    }//main

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,679
    My guess is your installation is broken. There is more to installing mingw than just downloading it.

    I suggest you follow this link (and some of the links from that page) for relevant information.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Sunshine, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    4
    You should go to this path "mingw\bin\..lib/gcc/mingw32/4.5.2/include/c++/" and search for "wchar.h" file . If not exist there must download and coping it there .

  4. #4
    Registered User
    Join Date
    Mar 2011
    Location
    Baltimore Md. USA
    Posts
    58
    I will do that, thanks for the help. because I haven't used it before, I wasn't sure if I was screwing something up or something wasn't there. lol

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    How are you compiling the program? The path "..lib" looks suspicious, it should probably be "../lib".

    You really shouldn't fix a compiler by copying header files around. If it's broken, try downloading it again or try a different version. In general, when you want to install mingw you just need to download it into some directory, and then you may need to modify the PATH environment variable to contain the bin/ directory of mingw. That should be all that is required.
    Salem likes this.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  6. #6
    Registered User
    Join Date
    Jun 2005
    Posts
    6,679
    Quote Originally Posted by dwks View Post
    You really shouldn't fix a compiler by copying header files around.
    I agree, absolutely. Advising someone to just copy header files around is very dangerous.
    Salem likes this.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Sunshine, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need guidance.
    By FieryAbyss in forum C++ Programming
    Replies: 2
    Last Post: 10-21-2010, 11:52 PM
  2. Guidance, please.
    By mattagrimonti in forum C Programming
    Replies: 2
    Last Post: 11-26-2008, 08:50 AM
  3. In need of guidance
    By Xk4r in forum C Programming
    Replies: 8
    Last Post: 11-24-2008, 07:10 PM
  4. Need Guidance
    By hYph3n in forum C++ Programming
    Replies: 4
    Last Post: 02-29-2008, 02:09 PM
  5. In need of guidance
    By ajdspud in forum C++ Programming
    Replies: 5
    Last Post: 09-10-2006, 02:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21