Page 1 of 1

linking against vlc with the newest version 3.0.16

Posted: 08 Mar 2022 23:15
by kant33
Hello,
i would like to let u know, that i was able to include and link libvlc in its current version vlc 3.0.16 on windows.

Since i had trouble i googled it and i found this
https://chat.stackoverflow.com/rooms/10 ... broadhurst

Since the wiki and also in the chat it is stated, that the method is outdated, i would like to tell how i solved it.
Also in hope that someone will update the wiki, so others have a easier time.

1. download the version 3.0.16 x32 from the website
2. download the source for 3.0.16
3. using this https://wiki.videolan.org/GenerateLibFromDll/
4. when trying to link against the created libvlc u get an error.

something like a undefinied symbol in libvlc_media.h
i just changed the file

//typedef ssize_t (*libvlc_media_read_cb)(void *opaque, unsigned char *buf,
// size_t len); <--- old
typedef int (*libvlc_media_read_cb)(void* opaque, unsigned char* buf, size_t len); <--- new

(i notitced that the other functions use int and not ssize_t, so i tried to replace it)
and thats it. it works like a charm

When i tried to compile, it works without problems. not only linking and compiling , but also playing videos without any problems.
i dont know if this might cause any problems, but i dont think it will, since its just an return value anyways.

would be nice if a develeoper could check if they can replace it aswell. and fix this problem for good.

also again, i hope somebody can update the wiki

thxfor ur work on vlc

Re: linking against vlc with the newest version 3.0.16

Posted: 09 Mar 2022 03:58
by mfkl
Looks like you are using master, as 3.0 branch has not changed regarding this https://code.videolan.org/videolan/vlc/ ... dia.h#L368

See https://code.videolan.org/videolan/vlc/ ... uests/1512 for context. Your patch doesn't seem correct.

Re: linking against vlc with the newest version 3.0.16

Posted: 09 Mar 2022 17:14
by RĂ©mi Denis-Courmont
We are not going to break binary compatibility within 3.0.x to accommodate one subpar platform.

Re: linking against vlc with the newest version 3.0.16

Posted: 10 Mar 2022 18:06
by mangokm40
It's been a while since I looked at this. I think I wound up defining 'ssize_t' as 'SSIZE_T' for my VS2017 compile/link.