Love this site? Hate it? Leave us some comments.
*/
*/

Read Post

Beginner C/C++

Moderators: Lundin
Number of threads: 4298
Number of posts: 13846

This Forum Only
Post New Thread

Report
An odd Dev-C++ Linker Error Posted by Aphelion on on 8 May 2008 at 10:32 PM
Hello programmers. =)

I'm trying to use Bloodshed's most recent Dev-C++ release (v. 4.9.9.2) to compile C++ programs that will run from Windows command prompt (MSDOS). However, I've been encountering an odd linker error, and I've been unable to find any references to it on the Web. Here is the code of my very simple test program:
#include <cstdlib>
#include <iostream>
using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    
    return EXIT_SUCCESS;
}

This program compiles fine under the UNIX system we use for our C++ class. However, when I try to compile this code using Dev-C++, I'm given the following error:
[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status

I'm stumped. =/

Is there anyone who can explain this error to me and perhaps offer a solution?
Reply
Report
Re: An odd Dev-C++ Linker Error Posted by Lundin on on 8 May 2008 at 11:28 PM
That code works perfectly in Dev C++ 4.9.9.2, so it seems the problem might be related to either compiler settings or a corrupt installation. Here's the compiler log I get:

Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\CPP\deleteme\Untitled1.cpp" -o "C:\CPP\deleteme\Untitled1.exe" -g3 -I"C:\Program\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Program\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Program\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Program\Dev-Cpp\include\c++\3.4.2" -I"C:\Program\Dev-Cpp\include" -L"C:\Program\Dev-Cpp\lib" -g3
Execution terminated
Compilation successful
Reply




corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.
Resource Listings