Installing and integrating OpenNI with CodeBlocks

Hello all
I am not able to correctly install or use OpenNI2. I followed the steps:
downloaded
sudo ./install.sh
source openNI*

What do i do with the OpenNI2_include and openNI2_redist paths?

What all settings must i change in build options (linker, etc) to be able to use OpenNI with codeblocks?

Currently, when i try to compile SimpleViewer(cpp) in CodeBlocks, i get multiple errors in OpenNI.h, regarding undefined reference to functions like oniFrameRelease(), oniStreamStop(), etc.