Box2D Forums

It is currently Thu Jul 24, 2014 6:03 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Feb 16, 2010 10:08 am 
Offline

Joined: Tue Sep 18, 2007 6:17 am
Posts: 155
Location: Western Cape, South Africa
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.


Top
 Profile  
 
PostPosted: Tue Feb 16, 2010 10:50 am 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2946
I don't run Code Blocks, so I'm depending on community input to adapt the Cmake files to other environments.


Top
 Profile  
 
PostPosted: Tue Feb 16, 2010 12:53 pm 
Offline

Joined: Tue Sep 18, 2007 6:17 am
Posts: 155
Location: Western Cape, South Africa
Ah, gotcha. I don't know the first thing about cmake (besides the actual making) or the error being raised.

Any collaborators?


Top
 Profile  
 
PostPosted: Tue Feb 16, 2010 1:07 pm 
Offline

Joined: Mon Jul 27, 2009 6:46 am
Posts: 236
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


Top
 Profile  
 
PostPosted: Sun Mar 28, 2010 9:06 pm 
Offline

Joined: Sun Mar 28, 2010 8:58 pm
Posts: 1
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


Attachments:
codeblockc-cmake-fix.patch [583 Bytes]
Downloaded 414 times
Top
 Profile  
 
PostPosted: Fri May 07, 2010 9:09 am 
Offline

Joined: Sun Apr 04, 2010 3:24 am
Posts: 3
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 :D


Top
 Profile  
 
PostPosted: Mon May 23, 2011 11:58 am 
Offline

Joined: Mon May 23, 2011 11:48 am
Posts: 1
Confirm it. It is compiling and working for me on win7 with codeblock.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group