Trouble in Building Code for Player/Stage in Eclipse CDT

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble in Building Code for Player/Stage in Eclipse CDT

Qaiduzzaman Khandker M.
Greetings,
I am using Player/Stage for my thesis work. But, I am getting a lot of error messages while I want to build this simple code in Eclipse CDT-

#include <iostream>

#include <playerc++.h>

#include <playerclient.h>

#include <clientproxy.h>

using namespace std;


int main()

{

PlayerClient robot("localhost",6665);

return 0;

}


  The error message is:

08:40:02 **** Build of configuration Debug for project firstTest ****

make all

Building file: ../src/firstTest.cpp

Invoking: GCC C++ Compiler

g++ -I/usr/local/include/player-3.0/libplayerc++ -include/usr/local/include/player-3.0/libplayerc++/playerc++.h -include/usr/local/include/player-3.0/libplayerc++/clientproxy.h -include/usr/local/include/player-3.0/libplayerc++/playerc++config.h -include/usr/local/include/player-3.0/libplayerc++/playerclient.h -include/usr/local/include/player-3.0/libplayerc++/playererror.h -include/usr/local/include/player-3.0/libplayerc++/utility.h -O0 -g3 -Wall -c -fmessage-length=0 `pkg-config --cflags playerc++` -MMD -MP -MF"src/firstTest.d" -MT"src/firstTest.d" -o "src/firstTest.o" "../src/firstTest.cpp"

Finished building: ../src/firstTest.cpp

Building target: firstTest

Invoking: GCC C++ Linker

g++ `pkg-config --libs playerc++` -o "firstTest" ./src/firstTest.o

./src/firstTest.o: In function `main':

/home/nafees/workspace/firstTest/Debug/../src/firstTest.cpp:19: undefined reference to `PlayerCc::PlayerClient::PlayerClient(std::string, unsigned int, int)'

/home/nafees/workspace/firstTest/Debug/../src/firstTest.cpp:19: undefined reference to `PlayerCc::PlayerClient::~PlayerClient()'

collect2: error: ld returned 1 exit status

make: *** [firstTest] Error 1


08:40:02 Build Finished (took 514ms)



I have followed this nice tutorial posted by Jenny- http://yorkroboticist.blogspot.com/2010/03/playerstage-on-eclipse.html

In this link you will get the snapshots of my Eclipse Project Properties:
https://www.dropbox.com/sh/9hcmditufu0lt6v/AAChqD1-FMM9FhvTWpuOGMQ-a?dl=0

I have tried a lot of ways to remove this error. but, all in vein. Please help me to continue my thesis.

With thanks
Nafees
 

------------------------------------------------------------------------------

_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|

Re: Trouble in Building Code for Player/Stage in Eclipse CDT

Rich Mattes-2
First of all, your installation is in /usr/local, which means that
eclipse needs to have PKG_CONFIG_PATH environment variable set to
/usr/local/lib/pkgconfig.  If that doesn't work, then eclipse isn't
expanding the pkg-config call between the backticks.  You set the
include path to Player manually, which is why it go thorough the
compilation phase.  You can try setting the library location manually as
well.

Rich

On 11/13/2015 10:55 PM, Qaiduzzaman Khandker M. wrote:

> Greetings,
> I am using Player/Stage for my thesis work. But, I am getting a lot of
> error messages while I want to build this simple code in Eclipse CDT-
>
> *#include*<iostream>
>
> *#include*<playerc++.h>
>
> *#include*<playerclient.h>
>
> *#include*<clientproxy.h>
>
> *using**namespace*std;
>
>
> *int**main*()
>
> {
>
> _PlayerClient robot(__"localhost"__,6665);_
>
> *return*0;
>
> }
>
>
> The error message is:
>
> 08:40:02 **** Build of configuration Debug for project firstTest ****
>
> make all
>
> Building file: ../src/firstTest.cpp
>
> Invoking: GCC C++ Compiler
>
> g++ -I/usr/local/include/player-3.0/libplayerc++
> -include/usr/local/include/player-3.0/libplayerc++/playerc++.h
> -include/usr/local/include/player-3.0/libplayerc++/clientproxy.h
> -include/usr/local/include/player-3.0/libplayerc++/playerc++config.h
> -include/usr/local/include/player-3.0/libplayerc++/playerclient.h
> -include/usr/local/include/player-3.0/libplayerc++/playererror.h
> -include/usr/local/include/player-3.0/libplayerc++/utility.h -O0 -g3
> -Wall -c -fmessage-length=0 `pkg-config --cflags playerc++` -MMD -MP
> -MF"src/firstTest.d" -MT"src/firstTest.d" -o "src/firstTest.o"
> "../src/firstTest.cpp"
>
> Finished building: ../src/firstTest.cpp
>
> Building target: firstTest
>
> Invoking: GCC C++ Linker
>
> g++ `pkg-config --libs playerc++` -o "firstTest" ./src/firstTest.o
>
> ./src/firstTest.o: In function `main':
>
> /home/nafees/workspace/firstTest/Debug/../src/firstTest.cpp:19:
> undefined reference to
> `PlayerCc::PlayerClient::PlayerClient(std::string, unsigned int, int)'
>
> /home/nafees/workspace/firstTest/Debug/../src/firstTest.cpp:19:
> undefined reference to `PlayerCc::PlayerClient::~PlayerClient()'
>
> collect2: error: ld returned 1 exit status
>
> make: *** [firstTest] Error 1
>
>
> 08:40:02 Build Finished (took 514ms)
>
>
>
> I have followed this nice tutorial posted by Jenny-
> http://yorkroboticist.blogspot.com/2010/03/playerstage-on-eclipse.html
>
> In this link you will get the snapshots of my Eclipse Project Properties:
> https://www.dropbox.com/sh/9hcmditufu0lt6v/AAChqD1-FMM9FhvTWpuOGMQ-a?dl=0
>
> I have tried a lot of ways to remove this error. but, all in vein.
> Please help me to continue my thesis.
>
> With thanks
> Nafees
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Playerstage-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-users
>

------------------------------------------------------------------------------
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users