Simple program error

Discussion in 'C++' started by ...:::JA:::..., Jul 5, 2007.

  1. Hi,

    I using "Dev-C++", yesterday I was install Microsoft Visual Studio .NET 2003
    I need it for building python extensions.Since I was install it when I write
    some program
    in Dev-C++ for example:

    #include <iostream>
    using namespace std;

    int main(){
    int z;
    z=4;
    cout <<z<<endl;
    scanf("\n");
    return 0;
    }


    This is error of this program
    Error:

    [Linker error] undefined reference to `__cpu_features_init'
    ld returned 1 exit status


    If anybody know how to solve this problem please tell me, I will be very
    grateful!!!!!!!
    ...:::JA:::..., Jul 5, 2007
    #1
    1. Advertising

  2. ...:::JA:::...

    Marcus Kwok Guest

    ....:::JA:::... <> wrote:
    > #include <iostream>
    > using namespace std;
    >
    > int main(){
    > int z;
    > z=4;
    > cout <<z<<endl;
    > scanf("\n");


    scanf() requires you to #include <stdio.h> (or <cstdio> since you are
    using namespace std;).

    If you are just doing this to pause the screen, you could try

    cin.get();

    instead, since you are already #including <iostream>.

    > return 0;
    > }


    --
    Marcus Kwok
    Replace 'invalid' with 'net' to reply
    Marcus Kwok, Jul 5, 2007
    #2
    1. Advertising

  3. On 2007-07-05 13:29, ...:::JA:::... wrote:
    > Hi,
    >
    > I using "Dev-C++", yesterday I was install Microsoft Visual Studio .NET 2003
    > I need it for building python extensions.Since I was install it when I write
    > some program
    > in Dev-C++ for example:
    >
    > #include <iostream>
    > using namespace std;
    >
    > int main(){
    > int z;
    > z=4;
    > cout <<z<<endl;
    > scanf("\n");
    > return 0;
    > }
    >
    >
    > This is error of this program
    > Error:
    >
    > [Linker error] undefined reference to `__cpu_features_init'
    > ld returned 1 exit status
    >
    >
    > If anybody know how to solve this problem please tell me, I will be very
    > grateful!!!!!!!


    Best bet: reinstall Dev-C++.

    --
    Erik Wikström
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=, Jul 5, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jack
    Replies:
    5
    Views:
    2,206
    yemen_eagle
    Apr 8, 2008
  2. Replies:
    7
    Views:
    622
    Stig Brautaset
    Jul 23, 2003
  3. Replies:
    10
    Views:
    540
    Dennis Lee Bieber
    Aug 15, 2006
  4. Replies:
    14
    Views:
    516
    Karl Heinz Buchegger
    Nov 2, 2005
  5. RichardOnRails
    Replies:
    3
    Views:
    117
    RichardOnRails
    Jul 21, 2008
Loading...

Share This Page