Problems in compiling RTT for RTEMS

Sambeet Panigrahi sambeet161616 at gmail.com
Fri Jul 8 08:23:59 UTC 2016


Hi,
I am trying to compile RTT for RTEMS. I have made the necesary changes in
the OS headers for RTEMS for i386 architecture.However on building I get
the following error.

home/sambeet/NewRockPort/x86/Build/rock/rtt/rtt/plugin/PluginLoader.cpp:711:9:
error: 'loading_lib' does not name a type
         loading_lib.createService =
(Service::shared_ptr(*)(void))(dlsym(handle, "createService") );
         ^
/home/sambeet/NewRockPort/x86/Build/rock/rtt/rtt/plugin/PluginLoader.cpp:712:9:
error: expected unqualified-id before 'if'
         if (loading_lib.createService)
         ^
/home/sambeet/NewRockPort/x86/Build/rock/rtt/rtt/plugin/PluginLoader.cpp:717:9:
error: expected unqualified-id before 'try'
         try {
         ^
/home/sambeet/NewRockPort/x86/Build/rock/rtt/rtt/plugin/PluginLoader.cpp:720:11:
error: expected unqualified-id before 'catch'
         } catch(std::exception& e) {
           ^
/home/sambeet/NewRockPort/x86/Build/rock/rtt/rtt/plugin/PluginLoader.cpp:722:11:
error: expected unqualified-id before 'catch'
         } catch(...) {
           ^
/home/sambeet/NewRockPort/x86/Build/rock/rtt/rtt/plugin/PluginLoader.cpp:726:9:
error: expected unqualified-id before 'if'
         if ( !success ) {
         ^
/home/sambeet/NewRockPort/x86/Build/rock/rtt/rtt/plugin/PluginLoader.cpp:731:9:
error: expected unqualified-id before 'if'
         if (kind == "typekit") {
         ^
/home/sambeet/NewRockPort/x86/Build/rock/rtt/rtt/plugin/PluginLoader.cpp:734:11:
error: expected unqualified-id before 'else'
         } else {
           ^
make[2]: ***
[rtt/CMakeFiles/orocos-rtt-rtems_static.dir/plugin/PluginLoader.cpp.o]
Error 1
make[1]: *** [rtt/CMakeFiles/orocos-rtt-rtems_static.dir/all] Error 2
make: *** [all] Error 2

I found that the first error is the root cause here.I found that the
 loading_lib object is declared as

log(Debug)<<"Found library "<<libname<<endlog();
    LoadedLib loading_lib(libname,shortname,handle);
    dlerror();    /* Clear any existing error */

Now in the PluginLoader.hpp file I find that the class LoadedLib has the
following structure

  */
            class LoadedLib{
            public:
                LoadedLib(std::string n, std::string short_name, void* h)
                : filename(n), shortname(short_name), handle(h),
loadPlugin(0), is_typekit(false), is_service(false)
                {
                }
                /**
                 * File name of the library.
                 */
                std::string filename;
                /**
                 * Short name of the library (without lib/dll/so)
                 */
                std::string shortname;
                /**
                 * Advertised name by the plugin.
                 */
                std::string plugname;
                void* handle;
                bool (*loadPlugin)(RTT::TaskContext*);
                RTT::ServicePtr (*createService)(void);
                bool is_typekit, is_service;
            };

The line causing the problem is related to

RTT::ServicePtr (*createService)(void);

And the I found that the RTT::ServicePtr is actually a typedef for a Boost
 ServicePtr

namespace RTT
{

    class Activity;
    class Alias;
    class CleanupHandle;
    class ConnPolicy;
    class ExecutionEngine;
    class Handle;
    class Logger;
    class PropertyBag;
    class ScopedHandle;
    class TaskContext;
    template<typename T>
    class Attribute;
    template<typename T>
    class Constant;
    template<typename T>
    class InputPort;
    template<typename FunctionT>
    class OperationCaller;
    template<class Signature>
    class Operation;
    template<typename T>
    class OutputPort;
    template<typename T>
    class Property;
    template<typename T>
    class SendHandle;
    struct ArgumentDescription;
    class ConfigurationInterface;
    class DataFlowInterface;
    class OperationInterface;
    class OperationInterfacePart;
    class Service;
    class ServiceRequester;
    typedef boost::shared_ptr<Service> ServicePtr;
}


I have not made major changes in the Pluginloader.cpp file and I have also
checked that required Boost libraries for
Service::shared_ptr(*)(void))(dlsym(handle, "createService") ) exists.
found that
. I don't understand why I get a 'does not name a type error'.

Can someone please help ?If more information is required please do mail me
or check my github repo
https://github.com/Sambeet161616/rtt

Thanks in advance.

Regards
Sambeet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160708/577d9e8e/attachment-0001.html>


More information about the users mailing list