Created a module but compilation "how to?"

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Pacific
Blank Cone
Blank Cone
Posts: 13
Joined: 09 Sep 2004 08:21
Location: Bharat

Created a module but compilation "how to?"

Postby Pacific » 21 Sep 2004 15:38

Hello,

First of all thank you everybody for making a b'ful system!
Please lemmi tell about what I am trying here.
OS: Win2K
Using Cygwin for building VLC-0.7.2
Followed "How to write an interface plugin" section of "VLC media player API Documentation" and I could write a module of my own which has main "Open", "Run", "Close" and some other routines. (Actually copied hotkey.c file and removed the hotkey's personalized code inside the routines.)
Previously for checking purpose I had empty Open, Run and close routines. After following steps as in "Arranging for your Module to get Compiled" and I could automatically get Makefile etc correctly. Then I did many changes in the MyOwnModule.cpp file but "make" does not seem to do anything. I am actually a windows user and so don't know much of unix commands except basic make, make clean etc.

Following is what I get when I do make:
...
...
...
make[4]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/playlist'
make[3]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/playlist'
make[2]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/playlist'
Making all in MyOwnModule
make[2]: Entering directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/MyOwnModule'
make all-recursive
make[3]: Entering directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/MyOwnModule'
make[4]: Entering directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/MyOwnModule'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/MyOwnModule'
make[3]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/MyOwnModule'
make[2]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/MyOwnModule'

make[2]: Entering directory `/cygdrive/d/work/vlc-0.7.2/modules/misc'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc'
make[1]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc'

Prashant@HJN /cygdrive/d/work/vlc-0.7.2/modules/misc
$

I purposely added wrong statements but make not giving error.
Please let me know if I am missing something.
Please let me know if there is any documentation for guys like me who are doing R&D over VLC. Later on I want to use the directX in the same module.

One more query:
I could add my own menu item in the VLC's menu. I want to show a dialog box with combo box, and some other controls over it. Please let me know if there is any documentation over this.
Thanks & Regards,
A1Pacific

Pacific
Blank Cone
Blank Cone
Posts: 13
Joined: 09 Sep 2004 08:21
Location: Bharat

Postby Pacific » 22 Sep 2004 08:50

Somebody please comment!

The DJ!?
markm!?
Sigmund!?
Thanks & Regards,
A1Pacific

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 22 Sep 2004 12:17

easy easy.
freetime and everything. i'm not watching these forums 24/7 you know!!!!
And people pushing for answers are asking to be ignored if you ask me....

answer... READ the file HACKING in the root of the sourcecode. You now created the files for a module, but you never added them to the vlc buildprocess.
Don't use PMs for support questions.

Pacific
Blank Cone
Blank Cone
Posts: 13
Joined: 09 Sep 2004 08:21
Location: Bharat

Postby Pacific » 23 Sep 2004 12:37

Hi "The DJ",

HACKING file didn't help me much but I studied other modules and gotto know that I need to have a DLL of my module.

Anyway, while I am doing make it is giving following error:
vlc_common.h : no such file etc.

Can you please through some light.
Prashant@ /cygdrive/d/work/vlc-0.7.2/modules/misc/MyModule
$ make libMyModule_plugin.dll
if g++ -mno-cygwin -DHAVE_CONFIG_H -I. -I. -I../../.. -I/usr/win32/include -I/
usr/win32/include/ebml -D_OFF_T_ -D_off_t=long -DSYS_MINGW32 -I../../../include
`top_builddir="../../.." ../../../vlc-config --cxxflags plugin MyModule` -Wsign
-compare -Wsign-compare -Wall -mms-bitfields -finline-limit-30000 -pipe -MT lib
MyModule_plugin_a-MyModule.o -MD -MP -MF ".deps/libMyModule_plugin_a-RecordSn
d.Tpo" \
-c -o libMyModule_plugin_a-MyModule.o `test -f 'MyModule.cpp' || echo './'`
MyModule.cpp; \
then mv ".deps/libMyModule_plugin_a-MyModule.Tpo" ".deps/libMyModule_plugin_a
-MyModule.Po"; \
else rm -f ".deps/libMyModule_plugin_a-MyModule.Tpo"; exit 1; \
fi
In file included from ../../../include/vlc/vlc.h:135,
from MyModule.cpp:23:
../../../include/vlc_common.h:883:25: vlc_symbols.h: No such file or directoryIn file included from ../../../include/vlc_common.h:886,
from ../../../include/vlc/vlc.h:135,
from MyModule.cpp:23:
../../../include/variables.h: In function `int __var_SetInteger(vlc_object_t*,
const char*, int)':
../../../include/variables.h:250: error: `__var_Set' undeclared (first use this

function)
../../../include/variables.h:250: error: (Each undeclared identifier is
reported only once for each function it appears in.)
../../../include/variables.h: In function `int __var_SetTime(vlc_object_t*,
const char*, long long int)':
../../../include/variables.h:264: error: `__var_Set' undeclared (first use this

function)
../../../include/variables.h: In function `int __var_SetFloat(vlc_object_t*,
const char*, float)':
../../../include/variables.h:278: error: `__var_Set' undeclared (first use this

function)
../../../include/variables.h: In function `int __var_SetVoid(vlc_object_t*,
const char*)':
../../../include/variables.h:291: error: `__var_Set' undeclared (first use this

function)
In file included from ../../../include/vlc_common.h:888,
from ../../../include/vlc/vlc.h:135,
from MyModule.cpp:23:
../../../include/vlc_threads_funcs.h: In function `int __vlc_mutex_lock(char*,
int, vlc_mutex_t*)':
../../../include/vlc_threads_funcs.h:126: error: `__msg_Generic' undeclared
(first use this function)
../../../include/vlc_threads_funcs.h: In function `int
__vlc_mutex_unlock(char*, int, vlc_mutex_t*)':
../../../include/vlc_threads_funcs.h:199: error: `__msg_Generic' undeclared
(first use this function)
../../../include/vlc_threads_funcs.h: In function `int __vlc_cond_signal(char*,

int, vlc_cond_t*)':
../../../include/vlc_threads_funcs.h:341: error: `__msg_Generic' undeclared
(first use this function)
../../../include/vlc_threads_funcs.h: In function `int
__vlc_cond_broadcast(char*, int, vlc_cond_t*)':
../../../include/vlc_threads_funcs.h:488: error: `__msg_Generic' undeclared
(first use this function)
../../../include/vlc_threads_funcs.h: In function `int __vlc_cond_wait(char*,
int, vlc_cond_t*, vlc_mutex_t*)':
../../../include/vlc_threads_funcs.h:674: error: `__msg_Generic' undeclared
(first use this function)
In file included from ../../../include/vlc_common.h:890,
from ../../../include/vlc/vlc.h:135,
from MyModule.cpp:23:
../../../include/modules.h: At global scope:
../../../include/modules.h:57: error: field `symbols' has incomplete type
In file included from ../../../include/input_ext-intf.h:30,
from ../../../include/vlc/intf.h:40,
from MyModule.cpp:24:
../../../include/ninput.h: In function `block_t* stream_Block(stream_t*, int)':
../../../include/ninput.h:223: error: `__block_New' undeclared (first use this
function)
MyModule.cpp: In function `int vlc_entry__0_7_2(module_t*)':
MyModule.cpp:40: error: `vlc_dgettext' undeclared (first use this function)
MyModule.cpp:43: error: `config_Duplicate' undeclared (first use this
function)
make: *** [libMyModule_plugin_a-MyModule.o] Error 1

Prashant@ /cygdrive/d/work/vlc-0.7.2/modules/misc/MyModule
$
Thanks & Regards,
A1Pacific

Pacific
Blank Cone
Blank Cone
Posts: 13
Joined: 09 Sep 2004 08:21
Location: Bharat

Postby Pacific » 23 Sep 2004 12:45

I searched in my : vlc-0.7.2 and really the file vlc_symbols.h isn't there.
:(
Thanks & Regards,
A1Pacific

Pacific
Blank Cone
Blank Cone
Posts: 13
Joined: 09 Sep 2004 08:21
Location: Bharat

Postby Pacific » 23 Sep 2004 12:56

I searched all files in vlc-0.7.2 directory and found that
in bootstrap file following is there:
##
## files which need to be regenerated
##
rm -f vlc-config.in vlc-config
rm -f src/misc/modules_builtin.h src/misc/modules_plugin.h
rm -f include/vlc_symbols.h
rm -f mozilla/vlcintf.h
So it is going to regenerate the files. I need to run ./bootstrap again.
Sorry...
Thanks & Regards,
A1Pacific

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 23 Sep 2004 14:45

you didn't read the HACKING file !!!!! :)
Don't use PMs for support questions.

Pacific
Blank Cone
Blank Cone
Posts: 13
Joined: 09 Sep 2004 08:21
Location: Bharat

Postby Pacific » 23 Sep 2004 15:48

Hello,

I read and followed the steps of HACKING. They are same as the steps given in "Arranging for your Module to get compiled-VLC interface-VLC API Documentation".

My module is now in the list of modules to be build by VLC.
But it is not generating .DLL out of .O files.
I have all the .O files created, but while creating .DLL it fails, following is the picture.

...
make[6]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/playlist'
make all-recursive
make[6]: Entering directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/playlist'
make[7]: Entering directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/playlist'
make[7]: Nothing to be done for `all-am'.
make[7]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/playlist'
make[6]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/playlist'
make[5]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/playlist'
Making all in MyOwnModule
make[5]: Entering directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/MyOwnModule'
make[6]: Entering directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/MyOwnModule'
if g++ -mno-cygwin -DHAVE_CONFIG_H -I. -I. -I../../.. -I/usr/win32/include -I/
usr/win32/include/ebml -D_OFF_T_ -D_off_t=long -DSYS_MINGW32 -I../../../include
`top_builddir="../../.." ../../../vlc-config --cxxflags plugin MyOwnModule` -Wsign
-compare -Wsign-compare -Wall -mms-bitfields -finline-limit-30000 -pipe -MT lib
MyOwnModule_plugin_a-MyOwnModule.o -MD -MP -MF ".deps/libMyOwnModule_plugin_a-MyOwnSn
d.Tpo" \
-c -o libMyOwnModule_plugin_a-MyOwnModule.o `test -f 'MyOwnModule.cpp' || echo './'`
MyOwnModule.cpp; \
then mv ".deps/libMyOwnModule_plugin_a-MyOwnModule.Tpo" ".deps/libMyOwnModule_plugin_a
-MyOwnModule.Po"; \
else rm -f ".deps/libMyOwnModule_plugin_a-MyOwnModule.Tpo"; exit 1; \
fi
libMyOwnModule_plugin_a-MyOwnModule.o libMyOwnModule_plugin_a-ActualMyOwnFuncs.o libMyOwn
Mod_plugin_a-rtcp.o libMyOwnModule_plugin_a-dsutil.o `top_builddir=../../.. ../../
../vlc-config --libs plugin MyOwnModule`
/bin/bash: line 1: libMyOwnModule_plugin_a-MyOwnModule.o: command not found
make[6]: *** [libMyOwnModule_plugin.dll] Error 127
make[6]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/MyOwnModule'
make[5]: *** [all-modules] Error 1
make[5]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc/MyOwnModule'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules/misc'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/cygdrive/d/work/vlc-0.7.2/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/d/work/vlc-0.7.2'
make: *** [all] Error 2

Prashant@ /cygdrive/d/work/vlc-0.7.2
$
The problem is $(CXXLINK) is missing. i couldn't find it anywhere.

Am I missing something? For creating DLL do we have do any extra steps?

I took the reference of /misc/playlist/export's makefile and it is syntactically same as /misc/mymodule/mymodule's makefile.

Here is the copy-paste of the statements from makefile about which I am talking:
libMyOwnModule_plugin$(LIBEXT): $(libMyOwnModule_plugin_a_OBJECTS)
@case `$(VLC_CONFIG) --linkage MyOwnModule` in \
c++) echo $(CXXLINK) $(libMyOwnModule_plugin_a_OBJECTS) \`$(VLC_CONFIG) --libs plugin MyOwnModule\` ; $(CXXLINK) $(libMyOwnModule_plugin_a_OBJECTS) `$(VLC_CONFIG) --libs plugin MyOwnModule` ;; \
objc) echo $(OBJCLINK) $(libMyOwnModule_plugin_a_OBJECTS) \`$(VLC_CONFIG) --libs plugin MyOwnModule\` ; $(OBJCLINK) $(libMyOwnModule_plugin_a_OBJECTS) `$(VLC_CONFIG) --libs plugin MyOwnModule` ;; \
c|*) echo $(LINK) $(libMyOwnModule_plugin_a_OBJECTS) \`$(VLC_CONFIG) --libs plugin MyOwnModule\` ; $(LINK) $(libMyOwnModule_plugin_a_OBJECTS) `$(VLC_CONFIG) --libs plugin MyOwnModule` ;; \
esac
Huh!!??

Please let me know if you can through light on it!!!
Thanks & Regards,
A1Pacific

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 23 Sep 2004 21:09

You are not supposed to change the makefile.

When you add a module abide to the following.

1: Add the new files to a new target in a Modules.am file. If you create a new directory (ill advised) you'll need to create a new Modules.am file.
2: add the name of the module (as defined in the Modules.am) to the configure.ac file BUILTIN_MODULES or something will do.
3: if your module needs any options, these have to be added in the configure.ac file (see other modules i.e. mkv or something)
4: rerun bootstrap and configure
Don't use PMs for support questions.

Pacific
Blank Cone
Blank Cone
Posts: 13
Joined: 09 Sep 2004 08:21
Location: Bharat

Postby Pacific » 24 Sep 2004 08:53

Hello,

Hey "The DJ" thank you for the comments.

Following are the steps I followed:(same as you said)

In VLC-0.7.2
|
+->Modules
|
+->misc
|
+->MyOwnModule
|
+->MyOwnFile.cpp
+->MyOwnFile2.cpp

In MyOwnModule directory I created "Modules.am" with following in it:
SOURCES_MyOwnModule = MyOwnFile.cpp MyOwnFile2.cpp

In vlc-0.7.2's "configure.ac" file's AC_CONFIG_FILES section I did following
...
AC_CONFIG_FILES([
modules/access/Makefile
modules/access/dshow/Makefile
...
modules/visualization/visual/Makefile
modules/misc/MyOwnModule/Makefile
])
...
The line marked BOLD is added.

In the same file:
dnl
dnl default modules
dnl
AX_ADD_PLUGINS([dummy rc telnet logger gestures memcpy hotkeys MyOwnModule])
....
AX_ADD_PLUGINS([access_ftp access_directory sap http])
The word marked BOLD is added.

then I ran bootstrap and configure: the command I give is:
./bootstrap && \
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
LDFLAGS=-L/usr/win32/lib \
CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" \
./configure \
--disable-sdl --disable-gtk \
--enable-nls \
--disable-skins \
--disable-skins2 \
--enable-ffmpeg --with-ffmpeg-zlib --with-ffmpeg-mp3lame --with-ffmpeg-faac \
--enable-faad \
--enable-flac \
--enable-theora \
--with-wx-config-path=/usr/win32/bin \
--with-freetype-config-path=/usr/win32/bin \
--with-fribidi-config-path=/usr/win32/bin \
--enable-livedotcom --with-livedotcom-tree=/usr/win32/live.com \
--enable-caca --with-caca-config-path=/usr/win32/bin \
--with-xml2-config-path=/usr/win32/bin \
--disable-dvd \
--disable-dvdnav \
--disable-dvdplay \
--disable-dvdread \
--without-dvdread \
--with-dvdnav-config-path=/usr/win32/bin \
--disable-cddax --disable-vcdx \
--enable-quicktime \
--enable-optimizations \
--enable-release
This properly creates makefile & .O files in MyOwnModule directory. But when I execute following :
$ make libMyOwnModule_plugin.dll

it fails to create .dll and gives following error:
/bin/bash: line 1: libMyOwnModule_plugin_a-MyOwnModule.o: command not found

this means some of the flags are not found and so "libMyOwnModule_plugin_a-MyOwnModule.o" line is coming as a start of command and so the error.

(Please note that I have not done anything with "AX_ADD_BUILTINS" as you said, cause my modules need no extra settings/options - please let me know if you think I am wrong here)

Thank you very much for reading my question. :!:

Please tell me if you can see what wrong thing I am doing.
Thanks & Regards,
A1Pacific


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 13 guests