Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Simple program error

Reply
Thread Tools

Simple program error

 
 
...:::JA:::...
Guest
Posts: n/a
 
      07-05-2007
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!!!!!!!




 
Reply With Quote
 
 
 
 
Marcus Kwok
Guest
Posts: n/a
 
      07-05-2007
....:::JA:::... <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?Erik_Wikstr=F6m?=
Guest
Posts: n/a
 
      07-05-2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple program with a simple(?) error -- what's wrong? RichardOnRails Ruby 3 07-21-2008 01:26 PM
"error C2057: expected constant expression", "error C2466: cannot allocate an array of constant size 0". Why doesn't my simple program work??? hn.ft.pris@gmail.com C++ 13 01-22-2007 02:03 PM
looking for a simple way to load a program from another python program.. Eric_Dexter@msn.com Python 10 08-15-2006 05:00 AM
Simple simple program error...please help tasheeta@gmail.com C++ 14 11-02-2005 12:52 PM
A few simple problems in a simple program. jmac@berkeley.edu C Programming 7 07-23-2003 09:51 PM



Advertisments