Re: function to check if a symbol in a library exists or not

  • From: Fjölnir Ásgeirsson <fjolnir@xxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 30 Jul 2012 16:48:11 +0900

Couldn't you just call dlsym and check for a nil result?

– Fjölnir

On Jul 30, 2012, at 16:23 , Josh Simmons <simmons.44@xxxxxxxxx> wrote:

> On Mon, Jul 30, 2012 at 4:46 PM, Cosmin Apreutesei
> <cosmin.apreutesei@xxxxxxxxx> wrote:
>> Hi,
>> 
>> Sometimes I need to know at runtime if a symbol is defined in a
>> library or not. Take cairo for instance, which contains the
>> appropriate symbols only for the backends that it was compiled with,
>> and it doesn't give you a "capabilities" API to tell you which those
>> backends are.
>> 
> 
> This sounds like a dodgy way to do it, would you not be better off
> parsing cairo's config.h for enabled backend defines?
> 


Other related posts: