Jump to content
  • Advertisement
Sign in to follow this  
Kenny77

Error Compiling With Code::Blocks

This topic is 3750 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a project I was working with in Dev-C++ but decided to switch to Code::Blocks because I figured the debugger would be better. But I get an error when I try to compile my working source in Code::Blocks; C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../crt2.o:crt1.c:(.text+0x167): undefined reference to `___cpu_features_init' Not having much experience with setting up/fixing compilers, I have no idea what it could be yelling at me for.

Share this post


Link to post
Share on other sites
Advertisement
You'll need to post some code... what is __cpu_features_init? An undefined reference usually means that a.) the function (if it's a function) has not been defined; There's a declaration, but no code. Often you didn't link a file that you needed. b.) I think the only way it can be a variable is if it's something like a global or static variable, where you can declare it in one file and use it in another.

And someone can correct me if I'm wrong, but don't Dev and Code::Blocks both use gdb? It may be easier to just go back to Dev-C++.

Share this post


Link to post
Share on other sites
Sounds like the compiler tries to link with an incompatible version of the runtime libraries. Since both DevC++ and C::B use the same compiler, but probably different versions, there might be same path configuration left by the former, which makes the latter find an obsolete CRT version.

That said, is there a specific reason you are using Code::Blocks ? You should very seriously consider switching to Visual C++ 2008 as soon as possible. Especially if you value a good debugger - the one from VC++ is a completely different world than GDB. And you won't get the runtime compatibility problems either ;)

Share this post


Link to post
Share on other sites
When you made the switch, did you have any temporary build files lying around (e.g. the .obj directory)?
If so, try deleting them, or using the "Rebuild Workspace" option in C::B.

Quote:
Original post by theOcelot
And someone can correct me if I'm wrong, but don't Dev and Code::Blocks both use gdb? It may be easier to just go back to Dev-C++.
C::B isn't tied to any compiler/debugger, you can use MSVC's tools with it if you like... From the OP it seems he is using gcc and gdb though.

Share this post


Link to post
Share on other sites
Quote:
Original post by Yann L
That said, is there a specific reason you are using Code::Blocks ? You should very seriously consider switching to Visual C++ 2008 as soon as possible. Especially if you value a good debugger - the one from VC++ is a completely different world than GDB. And you won't get the runtime compatibility problems either ;)


I was reading on Lazy Foo's site on how to set up 2005, but there doesn't seem to be a way to instal the Platform SDK offline (I'm working on a laptop).

Share this post


Link to post
Share on other sites
Quote:
Original post by Kenny77
I was reading on Lazy Foo's site on how to set up 2005, but there doesn't seem to be a way to instal the Platform SDK offline (I'm working on a laptop).

You can install the PSDK offline. But there is no need to. Download Visual Studio 2008 Express, which comes preinstalled with all the parts of the PSDK you'll need.

Share this post


Link to post
Share on other sites
http://forums.codeblocks.org/index.php?topic=8327.msg61788

simply google search: "gcc ___cpu_features_init"
I do it allways when some link error appears.
I suugest you to install minGW with gcc 4.3 version.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!