Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to build on debian jessie #17

Open
DickThomas opened this issue Jun 25, 2013 · 11 comments

Comments

Projects
None yet
4 participants
@DickThomas
Copy link

commented Jun 25, 2013

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?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/942860-fails-to-build-on-debian-jessie?utm_campaign=plugin&utm_content=tracker%2F256764&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F256764&utm_medium=issues&utm_source=github).
@lu-zero

This comment has been minimized.

Copy link
Owner

commented Jun 25, 2013

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 notifications@github.comwrote:

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//issues/17
.

@DickThomas

This comment has been minimized.

Copy link
Author

commented Jun 28, 2013

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

@DickThomas DickThomas closed this Jun 28, 2013

@DickThomas

This comment has been minimized.

Copy link
Author

commented Jun 30, 2013

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#

@DickThomas DickThomas reopened this Jun 30, 2013

@untergrundbahn

This comment has been minimized.

Copy link

commented Jul 9, 2013

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.

@untergrundbahn untergrundbahn referenced this issue Jul 10, 2013

Closed

bmdtools #19

@DickThomas

This comment has been minimized.

Copy link
Author

commented Jul 15, 2013

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

@lu-zero

This comment has been minimized.

Copy link
Owner

commented Jul 15, 2013

edit the makefile and/or define the pkg config environment variables.

On Mon, Jul 15, 2013 at 9:42 AM, Dick Thomas notifications@github.comwrote:

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//issues/17#issuecomment-20955480
.

lu-zero added a commit that referenced this issue Jul 20, 2013

@lu-zero

This comment has been minimized.

Copy link
Owner

commented Jul 20, 2013

Try the latest commit please.

@untergrundbahn

This comment has been minimized.

Copy link

commented Jul 20, 2013

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

@untergrundbahn

This comment has been minimized.

Copy link

commented Jul 20, 2013

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

@radojko

This comment has been minimized.

Copy link

commented Jul 21, 2013

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

@untergrundbahn

This comment has been minimized.

Copy link

commented Jul 21, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.