Sean Meighan
Welcome => Do You Need Help? Post it here => Topic started by: stampedeboss on March 08, 2016, 10:46:49 AM
-
I'm trying to build xLights on a Ubuntu/Mint 14.04 base system. I've gotten by the GCC and G++ 5.3 requirements by installing them from a PPA and then modifying the make to point to gcc-5, g++-5, gcc-ar-5. I had issues with the ffmpeg includes so I added the C_INCLUDE and CPLUS_INCLUDE environment variables.
I'm now stuck and receiving messages from make:
cannot find -lavformat-ffmpeg, -lavcodec-ffmpeg, -lavutil-ffmpeg, -lswresample-ffmpeg, -lswscale-ffmpeg...
collect2: error ld returned 1 exit status
make[1]: *** [out_linux_release] Error 1
make[1]: Leaving directory 'xLights/xLights'
make: *** [xlights] Error 2
Don't want to move to 15.10 due to short support window. Any suggestions?
-
Not too many days ago I saw a checkin for the Linux readme with this statement:
sudo apt-get install build-essential libgtk2.0-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev freeglut3-dev libmpg123-dev libwxgtk-media3.0-dev libavcodec-dev libavformat-dev libswscale-dev libsdl1.2-dev
39 40
That looks like it's supposed to retrieve and install the libraries you are missing. I have no idea whether the versions you are talking about matter.
-
I have installed all the documented packages before I started the install, which is why I'm confused.
-
I've done a little more digging and have found the following:
makefile points ld to library xxxxxx-fmpeg whereas the actual library was installed as xxxxxx.
Now what?
-
I don't know if it were me I'd find where that linker command is configured and change it to drop the "-ffmpeg" from all those libraries and see what happens.
-
Tried that but ended up with the following:
.objs/effects/VideoEffect.o
effects/VideoEffect.cpp: In constructor ‘VideoReader::VideoReader(std::string, int, int, bool)’:
effects/VideoEffect.cpp:116:29: error: ‘av_frame_alloc’ was not declared in this scope
_dstFrame = av_frame_alloc();
^
effects/VideoEffect.cpp: In member function ‘void VideoReader::Seek(int)’:
effects/VideoEffect.cpp:230:28: error: ‘av_packet_unref’ was not declared in this scope
av_packet_unref(&_packet);
^
effects/VideoEffect.cpp: In member function ‘AVFrame* VideoReader::GetNextFrame(int)’:
effects/VideoEffect.cpp:276:28: error: ‘av_packet_unref’ was not declared in this scope
av_packet_unref(&_packet);
^
make[1]: *** [.objs/effects/VideoEffect.o] Error 1
make[1]: Leaving directory `/srv/Shared/Software/linux/Christmas/xLights/xLights'
make: *** [xLights] Error 2
-
Well I was hoping one of our Linux folks would chime in. I'm sure there are a couple of them that have the code running.
Those errors look like compile time errors. I would expect that library name change to affect the link step not the compile step. If its during compile time it looks like a missing header file.
-
My dev system is too old to meet the new gcc version requirement so I need to get that resolved first. I might be able to try on a different system, I will have to see what I have that is new enough. I hate upgrading the OS and migrating so I normally stay on a stable (patched) version for years.
-
The core problem is that on Ubuntu 14.04 they didn't have the ffmpeg versions of the av* libraries.
They were only added in the 14.10 release (or later)
I did some testing that as it turns out on newer versions the libav*-ffmpeg libraries are linked to from the libav* stuff - so we can remove the -ffmpeg stuff and it still works on newer releases.
But even if that is done it won't help on your system :(
Sadly the version of libavcodec (9.18) is too old on ubuntu 14.04 and so is missing some functions such as 'av_packet_unref' which are used by xLights
There isn't really a way to work around this - you need to update to the libavcodec 11.x to get those functions.
This should be available in Ubuntu 15.04 or later (but has only been tested in 15.10 and newer)
-
:-[
-
The core problem is that on Ubuntu 14.04 they didn't have the ffmpeg versions of the av* libraries.
They were only added in the 14.10 release (or later)
I did some testing that as it turns out on newer versions the libav*-ffmpeg libraries are linked to from the libav* stuff - so we can remove the -ffmpeg stuff and it still works on newer releases.
But even if that is done it won't help on your system :(
Sadly the version of libavcodec (9.18) is too old on ubuntu 14.04 and so is missing some functions such as 'av_packet_unref' which are used by xLights
There isn't really a way to work around this - you need to update to the libavcodec 11.x to get those functions.
This should be available in Ubuntu 15.04 or later (but has only been tested in 15.10 and newer)
Thanks for the info Chris. Christ Debenham is from Australia and is the main person maintaining the Linux distributions. When we add new things to xLights, Chris comes along and fixes the Linux makefiles so that they will work. We appreciate Chris for Linux, Dan Kulp for MAC and Gil and Keith for Windows.
-
Well, I got it to work as follows:
I installed the 5.3 version of GCC/G++.
Downloaded and compiled wxWidget since it must match the compiler version.
Downloaded ffmpeg from ffmpeg.org via git clone and installed into /usr/local. I did not uninstall the existing which is installed in /usr.
I used the code:blocks ide and added the /usr/local to the search and link tabs.
I also used the following linker options:
s
-lGL -lGLU -lglut -ldl -lmpg123 -lX11
-lavformat -lavcodec -lavutil -lswresample -lswscale -lz -llzma -lm -lva
`sdl-config --libs`
`wx-config --version=3.0 --libs std,media,gl,aui`
I had to add the -lz, -llzma, -lm, and -lva libraries to make it all work.
I am now running on Mint 17.3 which is based on Ubuntu 14.04.
Hope someone finds this helpful.
-
Thought I would update anyone interested in installing on a 14.04 system. I just finished building the 2016.13 version without issue or modification to the xLights repository and used the make and make install without problems.
As I stated in my previous post you will need to add a ppa to enable the install of the 5.3 gcc and g++ compilers:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc5 g++5
I created a bash script so that I could switch between the normal compiler and version 5:
#!/bin/bash
cd /usr/bin
case $1 in
5|">")
sudo rm g++
sudo rm gcc
sudo rm gcc-ar
sudo rm gcc-nm
sudo rm gcc-ranlib
sudo ln -s g++-5 g++
sudo ln -s gcc-5 gcc
sudo ln -s gcc-ar-5 gcc-ar
sudo ln -s gcc-nm-5 gcc-nm
sudo ln -s gcc-ranlib-5 gcc-ranlib
;;
4|"<")
sudo rm g++
sudo rm gcc
sudo rm gcc-ar
sudo rm gcc-nm
sudo rm gcc-ranlib
sudo ln -s g++-4.8 g++
sudo ln -s gcc-4.8 gcc
sudo ln -s gcc-ar-4.8 gcc-ar
sudo ln -s gcc-nm-4.8 gcc-nm
sudo ln -s gcc-ranlib-4.8 gcc-ranlib
;;
*)
echo
;;
esac
ls -l gcc*
echo
ls -l g++*
this ensures as updates are placed on other packages no issues are encountered.
Follow the linux readme and install all of the required packages.
After switching the compilers to V5. you will also need to install and compile wxWidgets. If it is currently installed uninstall and reinstall following the instructions in the readme.
You will now need download the source for ffmpeg from the ffmpeg.org site, if you have git:
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd into it
configure --enable-shared
make -j$(nproc)
sudo make install (Now, qTox is able to be compiled)
sudo ldconfig (important)
You will find ffmpeg has been installed into the /usr/local/lib
since the current make file points to libavxxxxx-ffmpeg instead of just libavxxxx, you have two choices, modify the xLights.cbp.mak file removing the -ffmpeg or creating links with the -ffmpeg. I choose to create the links with:
sudo ln -s libavxxxx.x libavxxxx-ffmpeg.x (for both a and so)
sudo ln -s libswxxxx.x libswxxx.x
xxxx should be repaced with each of the ffmpgeg libraries in directory
your now ready to build xLights with:
make
sudo make install
an alternative to the aliases is to use code:block and update the project build parameters.
Working without an issue.