Building box2d on codeblocks

I tried to build box2d on code blocks but i receive these errors:

Code:
E:\Box 2D\Box2D_v2.1.2\Box2D\Box2D\Dynamics\Contacts\b2TOISolver.cpp||In constructor 'b2TOISolver::b2TOISolver(b2StackAllocator*)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\Box2D\Dynamics\Contacts\b2TOISolver.cpp|41|warning: converting to non-pointer type 'int' from NULL|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_edittext.cpp||In member function 'int GLUI_EditText::find_word_break(int, int)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_edittext.cpp|934|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'virtual int GLUI_TextBox::mouse_down_handler(int, int)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|98|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|116|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'virtual int GLUI_TextBox::mouse_held_down_handler(int, int, bool)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|139|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|158|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'virtual int GLUI_TextBox::key_handler(unsigned char, int)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|174|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|312|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'virtual void GLUI_TextBox::activate(int)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|338|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|350|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'virtual void GLUI_TextBox::deactivate()':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|364|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|386|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'int GLUI_TextBox::update_substring_bounds()':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|511|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|549|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'void GLUI_TextBox::draw_text(int, int)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|573|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|657|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'void GLUI_TextBox::draw_insertion_pt()':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|777|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|851|warning: deprecated conversion from string constant to 'char*'|
E:\BOX2D~1\BOX2D_~1.2\Box2D\glui\GL\..\..\freeglut\GL\freeglut_std.h|60|warning: "NOMINMAX" redefined|
e:\gnustep\bin\..\lib\gcc\mingw32\4.5.0\include\c++\mingw32\bits\os_defines.h|46|note: this is the location of the previous definition|
E:\BOX2D~1\BOX2D_~1.2\Box2D\freeglut\GL\freeglut_std.h|60|warning: "NOMINMAX" redefined|
e:\gnustep\bin\..\lib\gcc\mingw32\4.5.0\include\c++\mingw32\bits\os_defines.h|46|note: this is the location of the previous definition|
E:\BOX2D~1\BOX2D_~1.2\Box2D\freeglut\GL\freeglut_std.h|60|warning: "NOMINMAX" redefined|
e:\gnustep\bin\..\lib\gcc\mingw32\4.5.0\include\c++\mingw32\bits\os_defines.h|46|note: this is the location of the previous definition|
E:\Box 2D\Box2D_v2.1.2\Box2D\Testbed\Tests\..\..\freeglut\GL\freeglut_std.h|60|warning: "NOMINMAX" redefined|
e:\gnustep\bin\..\lib\gcc\mingw32\4.5.0\include\c++\mingw32\bits\os_defines.h|46|note: this is the location of the previous definition|
..\freeglut\libfreeglut_static.a(freeglut_init.obj)freeglut_init.c|| undefined reference to `timeBeginPeriod@4'|
..\freeglut\libfreeglut_static.a(freeglut_init.obj)freeglut_init.c|| undefined reference to `timeEndPeriod@4'|
..\freeglut\libfreeglut_static.a(freeglut_main.obj)freeglut_main.c|| undefined reference to `timeGetTime@0'|
..\freeglut\libfreeglut_static.a(freeglut_joystick.obj)freeglut_joystick.c|| undefined reference to `joyGetPosEx@8'|
..\freeglut\libfreeglut_static.a(freeglut_joystick.obj)freeglut_joystick.c|| undefined reference to `joyGetDevCapsA@12'|
||=== Build finished: 9 errors, 22 warnings ===|


Edit:
I fixed some error caused by not linked winmm, but i still have some:
Code:
||=== Box2D, all ===|
E:\Box 2D\Box2D_v2.1.2\Box2D\Box2D\Dynamics\Contacts\b2TOISolver.cpp||In constructor 'b2TOISolver::b2TOISolver(b2StackAllocator*)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\Box2D\Dynamics\Contacts\b2TOISolver.cpp|41|warning: converting to non-pointer type 'int' from NULL|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_edittext.cpp||In member function 'int GLUI_EditText::find_word_break(int, int)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_edittext.cpp|934|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'virtual int GLUI_TextBox::mouse_down_handler(int, int)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|98|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|116|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'virtual int GLUI_TextBox::mouse_held_down_handler(int, int, bool)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|139|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|158|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'virtual int GLUI_TextBox::key_handler(unsigned char, int)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|174|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|312|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'virtual void GLUI_TextBox::activate(int)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|338|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|350|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'virtual void GLUI_TextBox::deactivate()':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|364|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|386|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'int GLUI_TextBox::update_substring_bounds()':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|511|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|549|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'void GLUI_TextBox::draw_text(int, int)':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|573|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|657|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp||In member function 'void GLUI_TextBox::draw_insertion_pt()':|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|777|warning: deprecated conversion from string constant to 'char*'|
E:\Box 2D\Box2D_v2.1.2\Box2D\glui\glui_textbox.cpp|851|warning: deprecated conversion from string constant to 'char*'|
E:\BOX2D~1\BOX2D_~1.2\Box2D\glui\GL\..\..\freeglut\GL\freeglut_std.h|60|warning: "NOMINMAX" redefined|
e:\gnustep\bin\..\lib\gcc\mingw32\4.5.0\include\c++\mingw32\bits\os_defines.h|46|note: this is the location of the previous definition|
E:\BOX2D~1\BOX2D_~1.2\Box2D\freeglut\GL\freeglut_std.h|60|warning: "NOMINMAX" redefined|
e:\gnustep\bin\..\lib\gcc\mingw32\4.5.0\include\c++\mingw32\bits\os_defines.h|46|note: this is the location of the previous definition|
E:\BOX2D~1\BOX2D_~1.2\Box2D\freeglut\GL\freeglut_std.h|60|warning: "NOMINMAX" redefined|
e:\gnustep\bin\..\lib\gcc\mingw32\4.5.0\include\c++\mingw32\bits\os_defines.h|46|note: this is the location of the previous definition|
E:\Box 2D\Box2D_v2.1.2\Box2D\Testbed\Tests\..\..\freeglut\GL\freeglut_std.h|60|warning: "NOMINMAX" redefined|
e:\gnustep\bin\..\lib\gcc\mingw32\4.5.0\include\c++\mingw32\bits\os_defines.h|46|note: this is the location of the previous definition|
||=== Build finished: 4 errors, 22 warnings ===|
Can anyone help me?

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