build errors and cin problem

This is a discussion on build errors and cin problem within the C++ Programming forums, part of the General Programming Boards category; /*i am an absolute c++ beginner and am having problems compiling even this very simple code. am using the bloodshed ...

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    2

    Question build errors and cin problem

    /*i am an absolute c++ beginner and am having problems compiling even this very simple code. am using the bloodshed dev-c++
    v.4.9.8.0. */

    #include <iostream>
    #include <string>
    using namespace std;
    string name = "";
    int main(void)
    {
    cout<< "what is your name?";
    cin>>name;
    cout<<endl<< "hello " << name.c_str() ;

    return 0;
    }

    // the compiler errors are:
    29 C:\Dev-Cpp\Makefile.win
    [Build Error] [Warning] overriding commands for target `"cin'
    26 C:\Dev-Cpp\Makefile.win
    [Build Error] [Warning] ignoring old commands for target `"cin'
    make.exe C:\Dev-Cpp\make.exe
    Circular "cin <- "cin dependency dropped.

    // something is obviously wrong, but what? Thanks

  2. #2
    Disturbed Boy gustavosserra's Avatar
    Join Date
    Apr 2003
    Posts
    244
    Strange, this code compiles well in my Dev (same version).
    Nothing more to tell about me...
    Happy day =)

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    16
    Yeah worked fine for me

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,645
    What is the name of you source file?

    Try calling it "program.cpp".

    gg

  5. #5
    Registered User
    Join Date
    Apr 2004
    Posts
    2
    thanks codeplug. renaming the cpp file allowed it to compile. any idea as to why?
    thanks again!

  6. #6
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,645
    >> any idea as to why?
    Nope. If you tell us what the name of your file was, perhaps someone with Dev-C++ can investigate.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems with cin and GetAsyncKeyState
    By KgNe in forum C++ Programming
    Replies: 32
    Last Post: 08-21-2008, 10:00 AM
  2. Sneaky little linker errors...
    By Tozar in forum C++ Programming
    Replies: 8
    Last Post: 10-25-2006, 05:40 AM
  3. cin not allowing input after first use of function
    By Peter5897 in forum C++ Programming
    Replies: 5
    Last Post: 01-31-2006, 05:29 PM
  4. array errors
    By guda in forum C++ Programming
    Replies: 3
    Last Post: 11-24-2004, 11:52 AM
  5. Weird errors in code
    By sirSolarius in forum C++ Programming
    Replies: 6
    Last Post: 09-28-2003, 09:55 AM

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