Your compilation fails at the linking stage, so environment variables have nothing to do with it.
You're missing the correct link parameter from your gcc line.

Should be something along the lines of
-lplayercore
Try adding this at the end of your gcc line.

Also you could ask the system what is the correct include instruction with something like this (maybe it's not dpkg, not sure right now)
dpkg --libs 'playercore'


Claudio
-- Sent from my ParanoidAndroid Galaxy Nexus with K-9 Mail.

Punit Mittal <punit.mittal06@gmail.com> wrote:
hello sir/madam

when i am compiling laserobstacleavoid.cc
i get the following errors.
punit@punit:~/player-3.0.2/examples/libplayerc++$ g++ -o laserobstacleavoid '-I/usr/local/include/player-3.0' laserobstacleavoid.cc  '-L/usr/local/lib'

/tmp/ccZv63yz.o: In function `main':
laserobstacleavoid.cc:(.text+0x3a1): undefined reference to `PlayerCc::PlayerClient::PlayerClient(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, int)'
laserobstacleavoid.cc:(.text+0x3d3): undefined reference to `PlayerCc::Position2dProxy::Position2dProxy(PlayerCc::PlayerClient*, unsigned int)'
laserobstacleavoid.cc:(.text+0x3f3): undefined reference to `PlayerCc::LaserProxy::LaserProxy(PlayerCc::PlayerClient*, unsigned int)'
laserobstacleavoid.cc:(.text+0x40a): undefined reference to `std::operator<<(std::basic_ostream<char, std::char_traits<char> >&, PlayerCc::PlayerClient const&)'
laserobstacleavoid.cc:(.text+0x431): undefined reference to `PlayerCc::Position2dProxy::SetMotorEnable(bool)'
laserobstacleavoid.cc:(.text+0x452): undefined reference to `PlayerCc::PlayerClient::Read()'
laserobstacleavoid.cc:(.text+0x68b): undefined reference to `PlayerCc::LaserProxy::~LaserProxy()'
laserobstacleavoid.cc:(.text+0x6a0): undefined reference to `PlayerCc::Position2dProxy::~Position2dProxy()'
laserobstacleavoid.cc:(.text+0x6b5): undefined reference to `PlayerCc::PlayerClient::~PlayerClient()'
laserobstacleavoid.cc:(.text+0x6ff): undefined reference to `std::operator<<(std::basic_ostream<char, std::char_traits<char> >&, PlayerCc::PlayerError const&)'
/tmp/ccZv63yz.o: In function `PlayerCc::Position2dProxy::SetSpeed(double, double)':
laserobstacleavoid.cc:(.text._ZN8PlayerCc15Position2dProxy8SetSpeedEdd[PlayerCc::Position2dProxy::SetSpeed(double, double)]+0x39): undefined reference to `PlayerCc::Position2dProxy::SetSpeed(double, double, double)'
collect2: ld returned 1 exit status

i have set following path in .bashrc file

export PKG_CONFIG_PATH+=/usr/local/lib/pkgconfig
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export CPATH="$CPATH:/usr/local/include/player-3.0"
export PATH="$PATH:/usr/local/share/player/bin"
export STAGEPATH=/usr/local/lib
export PLAYERPATH=/usr/local/lib

i have installed player 3.0.2 and stage 3.2.2 on Ubuntu 12.04LTS
please help me solved out this problem

Thank you