First Module: Not recognized by VLC

This forum is about all development around libVLC.
Lehm
New Cone
New Cone
Posts: 4
Joined: 16 Dec 2016 06:52

First Module: Not recognized by VLC

Postby Lehm » 17 Dec 2016 00:22

Greetings! I am working on my first module for VLC as a side project. I'm normally a Visual Studio developer and not at all used to using make files to cross compile on linux. However I managed to muddle my way through the tutorials and can successfully compile (out of tree) a very basic useless module. However when I attempt to use it on the Windows version it doesn't appear in the list of recognized modules.

The steps I took:

Code:

Code: Select all

#include <vlc_common.h> #include <vlc_plugin.h> #define DOMAIN "vlc-myplugin" #define _(str) dgettext(DOMAIN, str) #define N_(str) (str) static int Open(vlc_object_t *); static void Close(vlc_object_t *); vlc_module_begin() set_shortname("mtm") set_description(N_("libmtm MTM support")) set_capability("access", 20) set_category(CAT_INPUT) set_subcategory(SUBCAT_INPUT_ACCESS) set_callbacks(Open, Close) vlc_module_end() static int Open(vlc_object_t *p_this){ return VLC_EGENERIC; } static inline void Close(vlc_object_t *obj){ }
I then run the make file. It has the effective command of:

Code: Select all

cc -std=gnu99 -I/home/user/projects/vlc/vlc/include -g -O2 -Wall -Wextra -fPIC -D__PLUGIN__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/local/include/vlc/plugins -shared -o libaccess_mtm_plugin.dll src/vlc_mtm_module.o -Wl,-no-undefined,-z,defs -L/usr/lib -L/usr/local/lib -lvlccore
Then I put it in the plugins/access directory.

Then I run vlc --reset-plugins-cache

Is there some part of the process I've missed or is something wrong with my make command? Any help is greatly appreciated.

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: First Module: Not recognized by VLC

Postby Rémi Denis-Courmont » 17 Dec 2016 19:48

Are you sure you built a Windows DLL, and not a Linux ELF shared object there?
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Lehm
New Cone
New Cone
Posts: 4
Joined: 16 Dec 2016 06:52

Re: First Module: Not recognized by VLC

Postby Lehm » 18 Dec 2016 02:29

Oh I'm unsure of anything at this point. I did look at the file in hex and I see the letters ELF at the beginning so I probably have an ELF shared object. I've spent the last 4 hours trying to figure out how to change it to produce a Windows DLL. Including looking at tutorials, reading the man files, going over the VLC info pages again. Nothing I've done seems to work. Got an example I can look at so I can see what I've got wrong?

Lehm
New Cone
New Cone
Posts: 4
Joined: 16 Dec 2016 06:52

Re: First Module: Not recognized by VLC

Postby Lehm » 19 Dec 2016 02:49

Okay I think I've made a bit more progress. I've learned that you have to use the correct compiler. I was looking for an option in the one I was using. So I've updated my build command to:

Code: Select all

x86_64-w64-mingw32-gcc -I/home/jeffadams/projects/vlc/vlc/include -fPIC -D__PLUGIN__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -I/usr/local/include -I/usr/local/include/vlc/plugins -shared -o libaccess_mtm_plugin.dll -Wl,-out-implib=libaccess_mtm_plugin.dll.a,-no-undefined src/vlc_mtm_module.o -L/usr/lib -L./lib -L/usr/local/lib -lvlccore
It looks like I am now building a Windows DLL as far as I can tell. However it still does not show up in vlc when placed in the plugins directory.

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: First Module: Not recognized by VLC

Postby Rémi Denis-Courmont » 19 Dec 2016 19:39

You need the compiler, linker and their respective flags to match.

Typically, example Makefiles cover native compilation for the sake of simplicity, and also partly by convention.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Lehm
New Cone
New Cone
Posts: 4
Joined: 16 Dec 2016 06:52

Re: First Module: Not recognized by VLC

Postby Lehm » 23 Dec 2016 04:27

Hmm... I've been trying the past two days to figure out what doesn't match. I can't find it. Is it the define flags? Are those wrong for a Windows Build?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: First Module: Not recognized by VLC

Postby Jean-Baptiste Kempf » 27 Dec 2016 11:41

Hmm... I've been trying the past two days to figure out what doesn't match. I can't find it. Is it the define flags? Are those wrong for a Windows Build?
When you launch VLC from a terminal with -vvv --list, it will show in yellow why some modules are not loaded.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 16 guests