CMake > Code::Blocks Fail!

I get the following errors when trying to build after generating a Code::Blocks project using cmake:

||=== Box2D, Testbed ===|
..\freeglut\libfreeglut_static.a(freeglut_main.c.obj)freeglut_main.c|| undefined reference to `timeGetTime@0'|
..\freeglut\libfreeglut_static.a(freeglut_init.c.obj)freeglut_init.c|| undefined reference to `timeBeginPeriod@4'|
..\freeglut\libfreeglut_static.a(freeglut_init.c.obj)freeglut_init.c|| undefined reference to `timeEndPeriod@4'|
..\freeglut\libfreeglut_static.a(freeglut_joystick.c.obj)freeglut_joystick.c|| undefined reference to `joyGetPosEx@8'|
..\freeglut\libfreeglut_static.a(freeglut_joystick.c.obj)freeglut_joystick.c|| undefined reference to `joyGetDevCapsA@12'|
||=== Build finished: 5 errors, 0 warnings ===|

Anyone have any ideas?

Thanks.
I don't run Code Blocks, so I'm depending on community input to adapt the Cmake files to other environments.
Ah, gotcha. I don't know the first thing about cmake (besides the actual making) or the error being raised.

Any collaborators?
timeGetTime and likewise functions require winmm.lib to be linked.
If this isn't a Windows build, you did something horribly wrong, as these are Windows API functions.
Generally this is due to the wrong preprocessor definition for the OS, or the lib assuming that nothing set means Windows.

Google result: http://msdn.microsoft.com/en-us/library ... 85%29.aspx

-P
Just in case it'll help someone, here is a simple update to the cmake files to let testbed build under Code::Blocks.

Edit: and by that I mean Code::Blocks on windows using Mingw32
I am running windows 7 with Eclipse and MinGW. I had the very same problem and solved it in a way similar to your patch.

I made a change in Box2D\Testbed\CMakeLists.txt
this way:

FROM:
Code:
target_link_libraries (
   Testbed
   Box2D
   freeglut_static
   glui
   ${OPENGL_LIBRARIES}
)


TO:
Code:
target_link_libraries (
   Testbed
   Box2D
   freeglut_static
   glui
   winmm
   ${OPENGL_LIBRARIES}
)


I simply added winmm and then it linked successfully 😀
Confirm it. It is compiling and working for me on win7 with codeblock.

Original thread: https://box2d.org/forum/viewtopic.php?t=4463