Hello,
I'm trying to write a simple program that will reset the world running on a
gazebo simulator. Here's the code, very short:
#include <stdio.h>
#include <gazebo.h>
#include <gazebo/WorldFile.hh>
#include <gazebo/World.hh>
World getRunningWorld() {
int serverId = 0;
World world (serverId, true);
return world;
}
void resetGazeboWorld() {
World world = getRunningWorld();
world.ResetModelPoses();
}
int main (int argc, char *argv[])
{
resetGazeboWorld();
return 0;
}
It compiles fine with:
g++ -Wall -g3 -I/usr/local/include -I/usr/local/include/gazebo -I../
-I/usr/.../Source/gazebo-0.5.2/server `pkg-config --cflags xml2` -c simple.cpp
But when I try to link it turning it into an executable:
g++ simple.o -o simple -L/usr/local/lib -lgazebo
-L/usr/.../Source/gazebo-0.5.2/server `pkg-config --libs xml2`
I get this error:
simple.o(.text+0x1b): In function `getRunningWorld()':
/home/.../workspace/libgazebo_java/simple/simple.cpp:15: undefined reference to
`World::World(int, bool)'
simple.o(.text+0x53): In function `resetGazeboWorld()':
/home/.../workspace/libgazebo_java/simple/simple.cpp:22: undefined reference to
`World::ResetModelPoses()'
simple.o(.text+0x73):/home/.../workspace/libgazebo_java/simple/simple.cpp:22:
undefined reference to `World::~World()'
simple.o(.text+0x99):/home/.../workspace/libgazebo_java/simple/simple.cpp:22:
undefined reference to `World::~World()'
collect2: ld returned 1 exit status
make: *** [simple] Error 1
Any help would be greatly appreciated.
Thanks
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Playerstage-gazebo mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo