fails to build on debian jessie
when i try and build i get the following
xpd259@mars:~/workspace/apps/Blackmagic DeckLink SDK 9.7.1/Linux/Samples/bmdtools$ make
g++ -o bmdcapture bmdcapture.cpp ../../include/DeckLinkAPIDispatch.cpp -Wno-multichar -I ../../include -fno-rtti -D__STDC_CONSTANT_MACROS -g -lm -ldl -lpthread pkg-config --libs libavformat libswscale
bmdcapture.cpp:194:61: error: use of enum ‘AVCodecID’ without previous declaration
bmdcapture.cpp: In function ‘AVStream* add_audio_stream(AVFormatContext_, int)’:
bmdcapture.cpp:207:21: error: invalid conversion from ‘int’ to ‘CodecID’ [-fpermissive]
bmdcapture.cpp: At global scope:
bmdcapture.cpp:234:61: error: use of enum ‘AVCodecID’ without previous declaration
bmdcapture.cpp: In function ‘AVStream_ add_video_stream(AVFormatContext_, int)’:
bmdcapture.cpp:247:21: error: invalid conversion from ‘int’ to ‘CodecID’ [-fpermissive]
bmdcapture.cpp:264:21: error: ‘AV_CODEC_ID_V210’ was not declared in this scope
bmdcapture.cpp: In function ‘int main(int, char__)’:
bmdcapture.cpp:846:51: error: ‘AV_CODEC_ID_RAWVIDEO’ was not declared in this scope
bmdcapture.cpp:846:74: error: ‘AV_CODEC_ID_V210’ was not declared in this scope
bmdcapture.cpp:847:59: error: ‘AV_CODEC_ID_PCM_S16LE’ was not declared in this scope
bmdcapture.cpp:847:83: error: ‘AV_CODEC_ID_PCM_S32LE’ was not declared in this scope
make: *_* [bmdcapture] Error 1
is this because i'm using debian Jessie/Testing?
which version of Libav are you using?
Please use release 9 and do test the audio branch.
On Tue, Jun 25, 2013 at 6:38 PM, Dick Thomas [email protected]:
when i try and build i get the following
xpd259@mars:~/workspace/apps/Blackmagic DeckLink SDK 9.7.1/Linux/Samples/bmdtools$ make g++ -o bmdcapture bmdcapture.cpp ../../include/DeckLinkAPIDispatch.cpp -Wno-multichar -I ../../include -fno-rtti -D__STDC_CONSTANT_MACROS -g -lm -ldl -lpthread pkg-config --libs libavformat libswscale bmdcapture.cpp:194:61: error: use of enum ‘AVCodecID’ without previous declaration bmdcapture.cpp: In function ‘AVStream* add_audio_stream(AVFormatContext_, int)’: bmdcapture.cpp:207:21: error: invalid conversion from ‘int’ to ‘CodecID’ [-fpermissive] bmdcapture.cpp: At global scope: bmdcapture.cpp:234:61: error: use of enum ‘AVCodecID’ without previous declaration bmdcapture.cpp: In function ‘AVStream_ add_video_stream(AVFormatContext_, int)’: bmdcapture.cpp:247:21: error: invalid conversion from ‘int’ to ‘CodecID’ [-fpermissive] bmdcapture.cpp:264:21: error: ‘AV_CODEC_ID_V210’ was not declared in this scope bmdcapture.cpp: In function ‘int main(int, char__)’: bmdcapture.cpp:846:51: error: ‘AV_CODEC_ID_RAWVIDEO’ was not declared in this scope bmdcapture.cpp:846:74: error: ‘AV_CODEC_ID_V210’ was not declared in this scope bmdcapture.cpp:847:59: error: ‘AV_CODEC_ID_PCM_S16LE’ was not declared in this scope bmdcapture.cpp:847:83: error: ‘AV_CODEC_ID_PCM_S32LE’ was not declared in this scope make: *_* [bmdcapture] Error 1
is this because i'm using debian Jessie/Testing?
— Reply to this email directly or view it on GitHubhttps://github.com/lu-zero/bmdtools/issues/17 .
Honestly I've not a clue how to use/install dev libs like that but... its in experimental so I will reopen the bug when the package is in testing so I can test it without breaking my "work" machine I also found a pre-compiled version of BMDTools so I will use them until I can "roll" my own and package it for debian
but thanks you for your quick reply
I've now made a virtual machine and installed what looks like libavformat9.6-2 and changed to the audio branch and I'm now getting a new error
root@debian:/home/xpd259/Blackmagic DeckLink SDK 9.7.1/Linux/Samples/bmdtools# aptitude -t experimental install libavformat-dev The following NEW packages will be installed: libavcodec-dev{a} libavformat-dev 0 packages upgraded, 2 newly installed, 0 to remove and 159 not upgraded. Need to get 0 B/3,332 kB of archives. After unpacking 12.5 MB will be used. Do you want to continue? [Y/n/?] Selecting previously unselected package libavcodec-dev. (Reading database ... 28621 files and directories currently installed.) Unpacking libavcodec-dev (from .../libavcodec-dev_6%3a9.6-2_amd64.deb) ... Selecting previously unselected package libavformat-dev. Unpacking libavformat-dev (from .../libavformat-dev_6%3a9.6-2_amd64.deb) ... Setting up libavcodec-dev (6:9.6-2) ... Setting up libavformat-dev (6:9.6-2) ...
xpd259@debian:/home/xpd259/Blackmagic DeckLink SDK 9.7.1/Linux/Samples/bmdtools# make
g++ -o bmdcapture bmdcapture.cpp ../../include/DeckLinkAPIDispatch.cpp -Wno-multichar -I ../../include -fno-rtti -D__STDC_CONSTANT_MACROS -g -lm -ldl -lpthread pkg-config --libs libavformat libswscale
/usr/bin/ld: /tmp/ccQ6wXni.o: undefined reference to symbol 'avcodec_open2@@LIBAVCODEC_54'
/usr/lib/x86_64-linux-gnu/libavcodec.so.54: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [bmdcapture] Error 1
xpd259@debian:/home/xpd259/Blackmagic DeckLink SDK 9.7.1/Linux/Samples/bmdtools#
What about error with usage of the libavformat9.6-2. First of all do check if avcodec_open2 symbol exists in the libavcodec.so library which installed in the system by the next command nm -D /usr/lib/x86_64-linux-gnu/libavcodec.so.54 | grep avcodec_open2. If it does then try to change pkg-config --libs libavformat libswscale to pkg-config --libs libavutil libavcodec libavformat libswscale in the Makefile. If it does not then you have to use another version of the libav.
okay I've got libavformat 9 built in a neighbouring dir with ./configure --enable-nonfree & make I don't want to do a sudo make install on the libs as that killed my Debian system but I've not a clue how to get make in bmdtools dir to link to my local plain9
edit the makefile and/or define the pkg config environment variables.
On Mon, Jul 15, 2013 at 9:42 AM, Dick Thomas [email protected]:
okay I've got libavformat 9 built in a neighbouring dir with ./configure --enable-nonfree & make I don't want to do a sudo make install on the libs as that killed my Debian system but I've not a clue how to get make in bmdtools dir to link to my local plain9
— Reply to this email directly or view it on GitHubhttps://github.com/lu-zero/bmdtools/issues/17#issuecomment-20955480 .
Try the latest commit please.
Some time ago I had same problem (now fixed in the last commit). I was getting the next error
$ make
g++ -o bmdcapture bmdcapture.cpp ../../include/DeckLinkAPIDispatch.cpp pkg-config --cflags libavformat libswscale -D__STDC_CONSTANT_MACROS -Wno-multichar -I ../../include -fno-rtti -g pkg-config --libs libavformat libswscale -lm -ldl -lpthread
/usr/bin/ld: /tmp/ccDWj8KM.o: undefined reference to symbol 'avcodec_open2@@LIBAVCODEC_55'
/usr/bin/ld: note: 'avcodec_open2@@LIBAVCODEC_55' is defined in DSO /usr/local/lib/libavcodec.so.55 so try adding it to the linker command line
/usr/local/lib/libavcodec.so.55: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [bmdcapture] Error 1
But with the last version I'm getting another error
$ make
g++ -o bmdcapture bmdcapture.cpp ../../include/DeckLinkAPIDispatch.cpp pkg-config --cflags libavcodec libavformat libswscale -D__STDC_CONSTANT_MACROS -Wno-multichar -I ../../include -fno-rtti -g pkg-config --libs libavcodec libavformat libswscale -lm -ldl -lpthread
/usr/bin/ld: /tmp/ccRSYcCe.o: undefined reference to symbol 'av_malloc@@LIBAVUTIL_52'
/usr/bin/ld: note: 'av_malloc@@LIBAVUTIL_52' is defined in DSO /usr/local/lib/libavutil.so.52 so try adding it to the linker command line
/usr/local/lib/libavutil.so.52: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [bmdcapture] Error 1
And this problem can can be fixed by adding libavutil to the PKG_DEPS list in the Makefile for me. Similar as I have told here
Speaking about that problem I can propose the next solution.
First of all build libav with some prefix and install it, on example
./configure --enable-nonfree --prefix=/home/user/bmdtools && make && make install
after that libav will be installed to the /home/user/bmdtools/{bin, lib, include, share} locations.
The next step is modify bmdtools Makefile. After
bindir ?= $(prefix)/bin
add the next lines
libdir ?= $(prefix)/lib ifeq ($(origin PKG_CONFIG_LIBDIR), undefined) export PKG_CONFIG_LIBDIR=$(libdir)/pkgconfig endif
and make bmdtools with prefix you've defined for the libav, on example
make prefix=/home/user/bmdtools
but if you don't want install bmdtools to the location which starts with prefix, you can add path used as libav prefix in the bmdtools Makefile or execute as command before run make
export PKG_CONFIG_LIBDIR=/home/user/bmdtools/lib/pkgconfig
UPD: Seems that case was already discussed there #14 and proposed to use export PKG_CONFIG_PATH=/home/user/bmdtools/lib/pkgconfig instead of export PKG_CONFIG_LIBDIR=/home/user/bmdtools/lib/pkgconfig
Thanks untergrundbahn, I solve problem changing Makefile file and building libav with prefix. Also, there is no prefix option in make, so in Makefile should be full path to libdir.
BTW. I'm on CentOS
You're right, it's my mistake, because make prefix=/home/user/bmdtools should be used instead of make --prefix=/home/user/bmdtools for make bmdtools. Also in such way you can specify bindir and libdir in command line.