[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++)

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.

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

Though to be honest, there are better choices for getting a GCC compiler on windows nowadays (http://www.codeblocks.org/)

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.

Thanks! Code:Blocks helped! This can be "solved" now.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.