Simple program error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ...:::JA:::...

    #1

    Simple program error

    Hi,

    I using "Dev-C++", yesterday I was install Microsoft Visual Studio .NET 2003
    I need it for building python extensions.Sinc e 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!!!!!!!




  • Marcus Kwok

    #2
    Re: Simple program error

    ....:::JA:::... <vedrandekovic@ v-programs.comwro te:
    #include <iostream>
    using namespace std;
    >
    int main(){
    int z;
    z=4;
    cout <<z<<endl;
    scanf("\n");
    scanf() requires you to #include <stdio.h(or <cstdiosince 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

    Comment

    • =?ISO-8859-1?Q?Erik_Wikstr=F6m?=

      #3
      Re: Simple program error

      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.Sinc e 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

      Comment

      Working...