解决DirectFB下的"No system found"

 

在运行directfb 应用程序的时候,大家有没有碰到过以下的错误: 

(!) DirectFB/core/system: No system found!
(#) DirectFBError [gdk_display_open: DirectFBCreate]: No (suitable) implementation found!

刚开始怀疑是framebuffer设备没有创建,但在/dev目录下查了下,有fb0,fb1目录,

应该可以排除这个问题了。

 

后来看了dfb_system_lookup源代码:

DFBResult dfb_system_lookup()
{
     DirectLink *l;

     direct_modules_explore_directory( &dfb_core_systems );

     direct_list_foreach( l, dfb_core_systems.entries ) {
          DirectModuleEntry     *module = (DirectModuleEntry*) l;
          const CoreSystemFuncs *funcs;

          funcs = direct_module_ref( module );
          if (!funcs)
               continue;

          if (!system_module || (!dfb_config->system ||
              !strcasecmp( dfb_config->system, module->name )))
          {
               if (system_module)
                    direct_module_unref( system_module );

               system_module = module;
               system_funcs  = funcs;

               funcs->GetSystemInfo( &system_info );
          }
          else
               direct_module_unref( module );
     }

     if (!system_module) {
          D_ERROR("DirectFB/core/system: No system found!\n");

          return DFB_NOIMPL;
     }

     return DFB_OK;
}

是系统模块找不到, 我找了对应的lib目录下能找到systems目录,

在lib/directfb-1.x-0目录下:

drwx------    1 16274    177             64 Jan  1 00:00 gfxdrivers
drwx------    1 16274    177            144 Jan  1 00:00 inputdrivers
drwx------    1 16274    177            100 Jan  1 00:00 interfaces
drwx------    1 16274    177             64 Jan  1 00:00 systems
drwx------    1 16274    177             72 Jan  1 00:00 wm

 

既然这样, 那就只能是路径问题了, 因为directfb不是我编译的, 怀疑其他人编译的时候在

./configure  的时候指定的模块路径跟当前目标版上的路径不一致,才导致找不到该模块了。

 

我查了下, directfb 的DirectFBInit()函数会处理一个环境变量DFBARGS,

可以利用一下,于是设置这个环境变量:

export DFBARGS=module-dir=<your path>/lib/directfb-1.x-0

然后再跑directfb应用, 果然, 问题解决了。

 


 

你可能感兴趣的:(list,Module,System)