How to compile smplayer

Forum to talk about the development of SMPlayer (code, patches...).

How to compile smplayer

Postby rvm » Wed Dec 23, 2009 2:51 pm

Hi.

I've just updated Install.txt, with the instructions to compile smplayer.

I copy it here. If you find some mistake, please tell me so I can fix it before smplayer 0.6.0 is released.

Install.txt:

This document explains how to compile and install smplayer.

Compiling smplayer should be easy. It only depends on Qt. Since version
0.5.40 it can only be compiled with Qt 4.2 or greater.


1) How to make a deb package
2) How to make a rpm package
3) Generic compilation
4) Changing installation path
5) How to compile in Windows


1) How to make a deb package
----------------------------
Be sure you have installed the following packages: libqt4-dev, fakeroot,
build-essential, devscripts, debhelper and g++.
Now run ./create_deb.sh


2) How to make a rpm package
----------------------------
Run rpmbuid -tb smplayer-0.6.x.tar.bz2
You'll find the rpm pachage under /usr/src/packages/RPMS/i586/

Take a look at this document to know how to create a rpm from the SVN sources:
http://smplayer.berlios.de/forums/viewtopic.php?id=188


3) Generic compilation
----------------------
You need at least Qt 4.2 to compile smplayer. It won't work with an older
version.

Be sure you have installed the Qt 4 development package. Its name maybe
qt4-devel, libqt4-dev or similar.

Uncompress the source code, open a console and enter in the
smplayer-0.6.x directory.

Type "make".

If everything is ok now you can install it with "make install".
That will install smplayer in /usr/local.

If "make" fails, it's probably because the Qt 3 qmake has been used instead of
the Qt 4 one. It seems that some distros have renamed that tool to qmake-qt4.
Others may have installed in another directory.
Look at the contents of the qt4-devel package (or whatever its name is) and
find out where it is.

Now type something like this (just examples):
make QMAKE=qmake-qt4
or
make QMAKE=/usr/share/qt4/bin/qmake


4) Changing installation path
-----------------------------
By default smplayer will be installed in /usr/local. You can change it by
using PREFIX and DESTDIR.

Examples:
make PREFIX=/usr
make PREFIX=/usr install

That would install smplayer under /usr.

DESTDIR will be useful for package maintainers.

make PREFIX=/usr
make PREFIX=/usr DESTDIR=/tmp/ install

That would compile smplayer for /usr but in fact it will be installed in
/tmp/usr/


5) How to compile in Windows
----------------------------
First you need to download and install Qt (OpenSource edition) in your
computer. You can get a package with installer from
http://trolltech.com/developer/downloads/qt/windows

During the installation it will ask you for a compiler. Simply let the
Qt installer to download and install MinGW.

Now we're ready to compile smplayer (or any other Qt application).
Download the sources (either the *.tar.gz or from the svn) and
uncompress them for example in C:\smplayer.

The next step is to open the Qt console: select the option "Qt 4.3.x
Command Prompt" that you'll find under the Qt menu.

That'll open a DOS-like window. Type the following commands:

cd c:\smplayer
compile_windows.bat

Compiling will start. That'll take a few minutes.

After that you'll get the new compiled smplayer.exe under
c:\smplayer\src\release subdirectory.

You'll see that if you try to open it by double clicking on it, it won't
work because it can find the Qt dlls. I assume you already have smplayer
properly installed in some place, just copy the new smplayer.exe to that
directory, replacing the old one. Now it will work

You may also need to copy the updated translation files (*.qm) from the
translations subdirectory.

Note: please see this document to know how to compile with Qxt support:
http://smplayer.berlios.de/forums/viewt ... 1737#p1737
rvm
Site Admin
 
Posts: 2650
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: How to compile smplayer

Postby richnicol » Mon May 02, 2011 4:41 pm

Absolutely spot on, word for word perfect. Worked like a dream for me. Thanks so much :)
richnicol
 
Posts: 1
Joined: Mon May 02, 2011 4:39 pm

Re: How to compile smplayer

Postby flecht » Mon Apr 16, 2012 3:01 pm

rvm wrote:2) How to make a rpm package
----------------------------
Run rpmbuid -tb smplayer-0.6.x.tar.bz2
You'll find the rpm pachage under /usr/src/packages/RPMS/i586/

In Fedora 16 x86_64, rpms are in ~/rpmbuild/RPMS/x86_64/
flecht
 
Posts: 16
Joined: Tue Mar 06, 2012 4:36 pm
Location: Polska

Re: How to compile smplayer

Postby jesse.zwd » Fri Nov 30, 2012 10:25 am

Hi,I am trying to compile smplayer, using QT 4.8, but an error ocurs:

in the zip.h file, #include "zlib.h", error :zlib.h: No such file or directory.

I think zlib should be included in the QT core libraries, right?


Thanks for your help in advance.
jesse.zwd
 
Posts: 4
Joined: Fri Nov 30, 2012 9:57 am

Re: How to compile smplayer

Postby rvm » Fri Nov 30, 2012 5:37 pm

You need zlib1g-dev.
rvm
Site Admin
 
Posts: 2650
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: How to compile smplayer

Postby jesse.zwd » Sat Dec 01, 2012 6:09 am

rvm wrote:You need zlib1g-dev.


My OS is linux mint, and I installed zlib1g-dev, it works ok, nice software and nice player.

Thanks a lot for your help!
jesse.zwd
 
Posts: 4
Joined: Fri Nov 30, 2012 9:57 am

Re: How to compile smplayer

Postby jza » Mon May 05, 2014 4:56 am

Hi I get the following output, I also had it with other qmake:
lsbc++ -c -pipe -Wall -W -O2 -DSINGLE_INSTANCE -DFIND_SUBTITLES -DVIDEOPREVIEW -DYOUTUBE_SUPPORT -DYT_USE_SCRIPT -DBLURAY_SUPPORT -DGUI_CHANGE_ON_RUNTIME -DLOG_MPLAYER -DLOG_SMPLAYER -DMPCGUI -DSKINS -DUPDATE_CHECKER -DCHECK_UPGRADED -DREMINDER_ACTIONS -DDOWNLOAD_SUBS -DDATA_PATH=\"/usr/local/share/smplayer\" -DDOC_PATH=\"/usr/local/share/doc/packages/smplayer\" -DTRANSLATION_PATH=\"/usr/local/share/smplayer/translations\" -DTHEMES_PATH=\"/usr/local/share/smplayer/themes\" -DSHORTCUTS_PATH=\"/usr/local/share/smplayer/shortcuts\" -DQT_NO_DEBUG -I/usr/lib/lsb-build-base/qt3/mkspecs/linux-lsb-qt3 -I. -Iqtsingleapplication -Ifindsubtitles -Ifindsubtitles/maia -Ifindsubtitles/filedownloader -Iyoutube -Impcgui -Iskingui -Ivideopreview -I/usr/include/lsb-build-base/qt3 -I.ui/ -I. -I.moc/ -o .obj/version.o version.cpp
In file included from version.cpp:19:0:
version.h:22:19: fatal error: QString: No such file or directory
compilation terminated.
make[1]: *** [.obj/version.o] Error 1
make[1]: Leaving directory `/home/jza/tmp/smplayer-14.3.0/src'
make: *** [src/smplayer] Error 2
JZA from Mandriva Linux 2012
jza
 
Posts: 5
Joined: Sun Mar 25, 2012 2:24 pm
Location: Cancun

Re: How to compile smplayer

Postby rvm » Mon May 05, 2014 12:26 pm

It seems you're trying to compile with Qt 3. It's necessary Qt 4.
rvm
Site Admin
 
Posts: 2650
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: How to compile smplayer

Postby jza » Mon May 05, 2014 4:12 pm

You were right, I had to do a QMAKE=/path/to/qt4/qmake and it went throught a bit farther, however I eventually found another sumbling block with the SeekWidget:
Code: Select all
In file included from prefinterface.h:22:0,
                 from preferencesdialog.cpp:25:
.ui/ui_prefinterface.h:86:5: error: ‘SeekWidget’ does not name a type
.ui/ui_prefinterface.h:87:5: error: ‘SeekWidget’ does not name a type
.ui/ui_prefinterface.h:88:5: error: ‘SeekWidget’ does not name a type
.ui/ui_prefinterface.h:89:5: error: ‘SeekWidget’ does not name a type
.ui/ui_prefinterface.h: In member function ‘void Ui_PrefInterface::setupUi(QWidget*)’:
.ui/ui_prefinterface.h:390:9: error: ‘seek1’ was not declared in this scope
.ui/ui_prefinterface.h:390:21: error: expected type-specifier before ‘SeekWidget’
.ui/ui_prefinterface.h:390:21: error: expected ‘;’ before ‘SeekWidget’
.ui/ui_prefinterface.h:395:9: error: ‘seek2’ was not declared in this scope
.ui/ui_prefinterface.h:395:21: error: expected type-specifier before ‘SeekWidget’
.ui/ui_prefinterface.h:395:21: error: expected ‘;’ before ‘SeekWidget’
.ui/ui_prefinterface.h:400:9: error: ‘seek3’ was not declared in this scope
.ui/ui_prefinterface.h:400:21: error: expected type-specifier before ‘SeekWidget’
.ui/ui_prefinterface.h:400:21: error: expected ‘;’ before ‘SeekWidget’
.ui/ui_prefinterface.h:405:9: error: ‘seek4’ was not declared in this scope
.ui/ui_prefinterface.h:405:21: error: expected type-specifier before ‘SeekWidget’
.ui/ui_prefinterface.h:405:21: error: expected ‘;’ before ‘SeekWidget’
make[1]: *** [.obj/preferencesdialog.o] Error 1
make[1]: Leaving directory `/home/jza/tmp/smplayer-14.3.0/src'
make: *** [src/smplayer] Error 2


The complete output is on this pastebin.
JZA from Mandriva Linux 2012
jza
 
Posts: 5
Joined: Sun Mar 25, 2012 2:24 pm
Location: Cancun

Re: How to compile smplayer

Postby rvm » Mon May 05, 2014 10:06 pm

I don't know. Maybe there's a generated file from your previous attempt with Qt 3. Run make distclean and try again.
rvm
Site Admin
 
Posts: 2650
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Next

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest