From: Hedayat V. <hed...@ai...> - 2010-04-04 21:04:17
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <title></title> </head> <body text="#000000" bgcolor="#ffffff"> Hi,<br> IMHO, the problem is that this class (BallStateAspect) is defined in the "soccer" plugin (in rcssserver3d project). Plugins are not linked to the applications (e.g. rcssserver3d) in our project (also notice that such libraries do not begin with "lib" prefix, so we have soccer.so not libsoccer.so), so if you use a class defined in a plugin you should link that library to your executable explicitly or include the corresponding source files as the executable sources.<br> <br> Good luck,<br> Hedayat<br> <br> <br> <span> <style type="text/css">blockquote {color: navy !important; background-color: RGB(245,245,245) !important; padding: 0 15 10 15 !important; margin: 15 0 0 0; border-left: #1010ff 2px solid;} blockquote blockquote {color: maroon !important; background-color: RGB(235,235,235) !important; border-left-color:maroon !important} blockquote blockquote blockquote {color: green !important; background-color: RGB(225,225,225) !important; border-left-color:teal !important} blockquote blockquote blockquote blockquote {color: purple !important; background-color: RGB(215,215,215) !important; border-left-color: purple !important} blockquote blockquote blockquote blockquote blockquote {color: teal !important; background-color: RGB(205,205,205) !important; border-left-color: green !important}</style><i><b>Huang Yaolong <a class="moz-txt-link-rfc2396E" href="mailto:air...@gm..."><air...@gm...></a></b></i> wrote on 03/31/2010 10:36:02 AM +0450:</span><br> <blockquote style="border-left: 2px solid rgb(16, 16, 255); color: navy; background-color: rgb(245, 245, 245); padding-left: 15px;" cite="mid:h2h...@ma..." type="cite">Hi, all.<br> <br> Today I tried to modify the main.cpp in rcssserver3d and run my test. But I got the following link error:<br> -------------------------------------------- <br clear="all"> CMakeFiles/rcssserver3d.dir/main.cpp.o: In function `boost::shared_ptr<BallStateAspect> boost::shared_dynamic_cast<BallStateAspect, zeitgeist::Leaf>(boost::shared_ptr<zeitgeist::Leaf> const&)':<br> main.cpp:(.text._ZN5boost19shared_dynamic_castI15BallStateAspectN9zeitgeist4LeafEEENS_10shared_ptrIT_EERKNS4_IT0_EE[boost::shared_ptr<BallStateAspect> boost::shared_dynamic_cast<BallStateAspect, zeitgeist::Leaf>(boost::shared_ptr<zeitgeist::Leaf> const&)]+0x29): undefined reference to `typeinfo for BallStateAspect'<br> collect2: ld returned 1 exit status<br> make[2]: *** [rcssserver3d/rcssserver3d] Error 1<br> make[1]: *** [rcssserver3d/CMakeFiles/rcssserver3d.dir/all] Error 2<br> make: *** [all] Error 2<br> ---------------------------------------------<br> <br> Here is my modification: (main.cpp is the modified version, main.bak.cpp is the original one)<br> <br> --- main.cpp��� 2010-03-31 13:54:31.000000000 +0800<br> +++ main.bak.cpp��� 2010-03-24 13:02:38.000000000 +0800<br> @@ -2,7 +2,7 @@<br> ��� this file is part of rcssserver3D<br> ��� Fri May 9 2003<br> ��� Copyright (C) 2003 Koblenz University<br> -�� $Id: main.cpp 140 2010-01-10 23:45:10Z hedayat $<br> +�� $Id: main.cpp 181 2010-02-28 10:55:34Z marianbuchta $<br> �<br> ��� This program is free software; you can redistribute it and/or modify<br> ��� it under the terms of the GNU General Public License as published by<br> @@ -25,12 +25,6 @@<br> �#include <kerosin/renderserver/rendercontrol.h><br> �#include <kerosin/inputserver/inputcontrol.h><br> �<br> -#include <salt/vector.h><br> -#include <oxygen/agentaspect/agentaspect.h><br> -#include <../plugin/soccer/ball/ball.h><br> -#include <../plugin/soccer/soccerbase/soccerbase.h><br> -#include <../plugin/soccer/soccertypes.h><br> -#include <../plugin/soccer/ballstateaspect/ballstateaspect.h><br> �#ifdef HAVE_CONFIG_H<br> �#undef PACKAGE_NAME<br> �#include <rcssserver3d_config.h><br> @@ -77,7 +71,7 @@<br> ���� GetLog()->Normal()<br> �������� << "rcssserver3d (formerly simspark), a monolithic simulator 0.6.1\n"<br> �������� << "Copyright (C) 2004 Markus Rollmann, \n"<br> -������� << "Universit?t Koblenz.\n"<br> +������� << "Universit�t Koblenz.\n"<br> �������� << "Copyright (C) 2004-2009, "<br> �������� << "The RoboCup Soccer Server Maintenance Group.\n"<br> �������� << "\nType '--help' for further information\n\n";<br> @@ -134,7 +128,7 @@<br> ���� GetScriptServer()->Run(mScriptPath);<br> �<br> ���� // tell the inputControl node the loaction of our camera<br> -��� shared_ptr<InputControl> inputCtr = GetInputControl();<br> +��� boost::shared_ptr<InputControl> inputCtr = GetInputControl();<br> ���� if (inputCtr.get() != 0)<br> ���� {<br> �������� inputCtr->SetFPSController("/usr/scene/camera/physics/controller");<br> @@ -142,63 +136,26 @@<br> �<br> ���� return true;<br> �}<br> -SimSpark sparkinstance("../../");<br> -void Test(){<br> - SimSpark *spark=&sparkinstance;<br> - int cycle=0;<br> - while(cycle<=0){<br> -� cycle=spark->GetSimulationServer()->GetCycle();<br> -� cout <<cycle <<endl;<br> -� spark->GetLog()->Normal()<< "Simulation Server was running\\n";<br> - }<br> - boost::shared_ptr<Ball> ball;<br> - shared_ptr<Scene> scene=spark->GetActiveScene();<br> - <br> - /*<br> - ball = shared_dynamic_cast<Ball><br> -����������� (spark->GetCore()->Get(scene->GetFullPath() + "Ball"));<br> - shared_ptr<BallStateAspect> ballStateAspect = shared_dynamic_cast<BallStateAspect><br> -����������� (spark->GetCore()->Get("/sys/server/gamecontrol/BallStateAspect"));<br> - boost::shared_ptr<oxygen::AgentAspect> agent = spark->GetSimulationServer()-><br> -� GetGameControlServer()->GetAgentAspect(1);<br> -� */<br> - <br> - <br> -<br> - const salt::Vector3f force(1.0,2.0,3.0);<br> - const salt::Vector3f torque(1.0,2.0,3.0);<br> - <br> - //ball->SetAcceleration(cycle, force,torque,agent);<br> - //ball->PrePhysicsUpdateInternal(10);<br> - //spark->GetSimulationServer()->GetSceneServer()-><br> - <br> - while(true){<br> -� //cout << agent->ID() << endl;<br> - }<br> -}<br> �<br> �int main(int argc, char** argv)<br> �{<br> ���� // the spark app framework instance<br> -�� <br> - <br> -��� if (! sparkinstance.Init(argc, argv))<br> +��� SimSpark spark("../../");<br> +<br> +��� if (! spark.Init(argc, argv))<br> ���� {<br> �������� return 1;<br> ���� }<br> - boost::thread thrd(Test);<br> - //thrd.detach();<br> -�� <br> - sparkinstance.GetSimulationServer()->Run(argc,argv);<br> - thrd.join();<br> �<br> -��� shared_ptr<RenderControl> renderCtr = sparkinstance.GetRenderControl();<br> +��� spark.GetSimulationServer()->Run(argc,argv);<br> +<br> +��� boost::shared_ptr<RenderControl> renderCtr = spark.GetRenderControl();<br> ���� if (renderCtr.get() != 0)<br> ���� {<br> -������� sparkinstance.GetLog()->Normal()<br> +������� spark.GetLog()->Normal()<br> ������������ << "Average FPS: "<br> ������������ << renderCtr->GetFramesRendered() /<br> -����������� sparkinstance.GetSimulationServer()->GetTime()<br> +����������� spark.GetSimulationServer()->GetTime()<br> ������������ << "\n";<br> ���� }<br> �<br> The link error appeared after I uncomment the following lines:<br> ===========================================<br> - ball = shared_dynamic_cast<Ball><br> -����������� (spark->GetCore()->Get(scene->GetFullPath() + "Ball"));<br> - shared_ptr<BallStateAspect> ballStateAspect = shared_dynamic_cast<BallStateAspect><br> -����������� (spark->GetCore()->Get("/sys/server/gamecontrol/BallStateAspect"));<br> - boost::shared_ptr<oxygen::AgentAspect> agent = spark->GetSimulationServer()-><br> -� GetGameControlServer()->GetAgentAspect(1);<br> ===========================================<br> <br> And I search on the net for the type of the error. It seems that some classes in the hierarchy have some null non-pure virtual functions.<br> What's the real problem about this error?? How do I get the modification work??<br> <br> -- <br> Best regards,<br> Yaolong Huang(Curtis)<br> <br> Tianjin University, China<br> <br> Blog: <a moz-do-not-send="true" href="http://blog.csdn.net/airekans/">http://blog.csdn.net/airekans/</a><br> <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset> ------------------------------------------------------------------------------ Download Intel&#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/intel-sw-dev">http://p.sf.net/sfu/intel-sw-dev</a> </pre> <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset> _______________________________________________ Simspark Generic Physical MAS Simulator simspark-devel mailing list <a class="moz-txt-link-abbreviated" href="mailto:sim...@li...">sim...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/simspark-devel">https://lists.sourceforge.net/lists/listinfo/simspark-devel</a> </pre> </blockquote> </body> </html> |