C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 16th, 2009, 12:30 AM
discer226 discer226 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Posts: 1 discer226 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 27 sec
Reputation Power: 0
Question General - "HELLO WORLD!"...help...

hey.
i'm just learning C++ and i'm doing the basic program: "HELLO WORLD!".
i am using dev-C++.

heres my problem, i put in the code:
#include <iostream>

int main()
{
std::cout << "HELLO WORLD!/n";
return 0;
}


Then i click compile/run and a message comes up saying:
"[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status"

What does it mean? how do i fix it?

thanks.

Reply With Quote
  #2  
Old January 16th, 2009, 01:15 PM
Chrisname Chrisname is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Posts: 32 Chrisname User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 14 m 3 sec
Reputation Power: 10
Quote:
Originally Posted by discer226
hey.
i'm just learning C++ and i'm doing the basic program: "HELLO WORLD!".
i am using dev-C++.

heres my problem, i put in the code:
#include <iostream>

int main()
{
std::cout << "HELLO WORLD!/n";
return 0;
}


Then i click compile/run and a message comes up saying:
"[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status"

What does it mean? how do i fix it?

thanks.


Hm, I can't figure it out either :S (I am a noob, but I get errors trying to compile it to...)

From one noob to another, instead of putting std::cout put
using namespace std;
between your include headers and calling main. That way you can just put cout. Also, I don't know if it makes any difference but instead of /n I put << endl; (all though thats probably because when I found I had time to come back to c++ I had forgotten how to do /n)

Also; instead of just putting "return 0;", if you want to see the output, put
system('pause');
or cin.get();
so it waits for you to "press any key to continue". Otherwise it just flashes the command line box and thats it. I used to think it was because of run-time errors... silly me :S


Sorry I can't help you with the linker error, I had one of those before but I don't remember how I fixed it.

I think it may be something todo with the headers you're using, you might need different headers (although I can't see why you would...).

Reply With Quote
  #3  
Old January 16th, 2009, 09:48 PM
tinit5190 tinit5190 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 57 tinit5190 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 31 m 46 sec
Reputation Power: 10
The problem that is occuring is a Lib error. Try re-downloading Dev-C++

Reply With Quote
  #4  
Old January 17th, 2009, 06:36 AM
Chrisname Chrisname is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Posts: 32 Chrisname User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 14 m 3 sec
Reputation Power: 10
Oh. Well that makes me look dumb =]
Oh well, I'm a noob anyway... so whatever.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > General - "HELLO WORLD!"...help...


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap