[Linker error] undefined reference to `__cpu_features_init' comes to

#include <stdio.h>
int main(){
char c;
printf("Hello World!");
scanf("%c", &c);

I don't think that it's code problem. What can I do? (Dev C++ newest version)
(I tried reinstalling DEV C++)

7 Years
Discussion Span
Last Post by Fbody

well, you don't have a return value.

but i dont know if that's the source of your error code. i don't use Dev C++ so I can't say. I use CodeBlocks (w/ MinGW on windows) or gcc (on linux).

I do recommend CodeBlocks, because it's my preference. I've heard criticisms of Dev-C++ that there are some various compile-related issues, but I've also heard people who love it.

It is important to note that DevC++ hasnt been updated since 2005, despite numerous complaints (many of which may have been user error). CodeBlocks stable release was 2 years ago.

If you try CodeBlocks, be sure to get the binary that includes MinGW.

EDIT: that reminds me... did you get the DevC++ version that comes with MinGW? if you didnt, then who knows how it's being compiled. that could cause the error.

Edited by jephthah: n/a


I remember seeing such things when trying to compile C code with a C++ compiler.

Well, the tutorial told Dev-C++ to compile C progs.


Dev-C++ comes with the MinGW compiler, but it's probably an old version. The Code::Blocks version is most likely newer.

You'll have to mark the thread "solved" yourself. There should be a "mark as solved" button at the bottom of the listing, next to the "Reply to this Thread" button.

Edited by Fbody: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.