CodeBlocks and mingw

Trying to compile on CodeBlocks and mingw I get too many errors.
- Create a GLUT project through the codeblocks project wizard and make sure that it compiles and runs.
- Then Rename main.cpp to LuaGL.c and replace the contents with the ones found in the fabiowguerra/svn/src/LuaGL.c
- Add a File->New->File..->C/C++ Header File, LuaGL.h paste the contents of the respective file from fabiowguerra/svn/include/LuaGL.h
- Continue the same process for the rest of the files. LuaGlu, LuaGlut, LuaGlAux.
- Create a new Dynamic Library build target from the menu File -> New.
- Add the liblua5.1.lib to the linker tab for the whole project in the Build Options dialog.
- Press built for the dll built target and watch the errors go!
At the moment I am having a lot undefined references from LuaGlu.c on the Lua API functions.