[vlc-devel] libvlccore, name-clashes and problems with getopt

Rémi Denis-Courmont remi at remlab.net
Tue Feb 23 17:36:42 CET 2010


   Hello,

----- Original message -----
> I'm trying to use libvlc for a project, and there are several potential
> clashes with libvlccore. The namespace uses in libvlc.so is fine, always
> libvlc_. But libvlc.so is linked against libvlccore.so where the
> namespaces are not consistent.

Whether it is a problem depends on the platform. Some could consider this is a bug in ELF. Some will say it is a feature (e.g. LD preload).

But it would be a major PITA to fix in VLC. I do not know if symbol versioning or anything can work-around this.

> When using libvlc in a program with getopt.. It is necessary to be
> sure that libvlc is initialized _only after_ the use of optind, etc,..
> Otherwise, libvlccore changes the value of optind for example,..

True. But Libvlc needs to parse its command line afterall. The only "fix" would require inlining getopt_long() which is not particularly clean either. But this is a thread-safety problem, so perhaps it has to be done anyway.

-- 
Rémi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100223/03726aae/attachment.html>


More information about the vlc-devel mailing list