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

QtAvplayer itself compiles on 6.7.1 but C++ code fails #476

Closed
chetan-prime opened this issue May 28, 2024 · 6 comments
Closed

QtAvplayer itself compiles on 6.7.1 but C++ code fails #476

chetan-prime opened this issue May 28, 2024 · 6 comments

Comments

@chetan-prime
Copy link

Platform: ios
OS: MacOS
XCode: 15.3
Qt: 6.7.1

An older version of QtAvplayer compiled fine on 6.7.0 but gave errors compiling on 6.7.1.
I used the latest version along with 'QtAVPlayer.cmake' including inside it. It compiles fine but while linking the final binary for ios, we get these errors:

Undefined symbols for architecture arm64: "QAVPlayer::audioFrame(QAVAudioFrame const&)", referenced from: QAVPlayerPrivate::doPlayAudio()::$_2::operator()(QAVFrame const&) const in libQtAVPlayer.a[2](qavplayer.cpp.o) LiveVideoPlayer::setVideoSink(QVideoSink*) in libbackend_APP.a[16](LiveVideoPlayer.o) "QAVPlayer::videoFrame(QAVVideoFrame const&)", referenced from: QAVPlayerPrivate::doPlayVideo()::$_1::operator()(QAVFrame const&) const in libQtAVPlayer.a[2](qavplayer.cpp.o) LiveVideoPlayer::setVideoSink(QVideoSink*) in libbackend_APP.a[16](LiveVideoPlayer.o) "QAVPlayer::stateChanged(QAVPlayer::State)", referenced from: QAVPlayerPrivate::setState(QAVPlayer::State) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::errorOccurred(QAVPlayer::Error, QString const&)", referenced from: QAVPlayerPrivate::setError(QAVPlayer::Error, QString const&) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::sourceChanged(QString const&)", referenced from: QAVPlayer::setSource(QString const&, QSharedPointer<QAVIODevice> const&) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::subtitleFrame(QAVSubtitleFrame const&)", referenced from: QAVPlayerPrivate::doPlaySubtitle()::$_3::operator()(QAVSubtitleFrame const&) const in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::durationChanged(long long)", referenced from: QAVPlayerPrivate::setDuration(double) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::seekableChanged(bool)", referenced from: QAVPlayerPrivate::setSeekable(bool) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::staticMetaObject", referenced from: LiveVideoPlayer::setVideoSink(QVideoSink*) in libbackend_APP.a[16](LiveVideoPlayer.o) QtPrivate::MetaObjectForType<QAVPlayer*, void>::metaObjectFunction(QtPrivate::QMetaTypeInterface const*) in libbackend_APP.a[22](mocs_compilation.o) QMetaTypeIdQObject<QAVPlayer*, 8>::qt_metatype_id() in libbackend_APP.a[22](mocs_compilation.o) "QAVPlayer::mediaStatusChanged(QAVPlayer::MediaStatus)", referenced from: QAVPlayerPrivate::setMediaStatus(QAVPlayer::MediaStatus) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::videoFrameRateChanged(double)", referenced from: QAVPlayerPrivate::setVideoFrameRate(double) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::paused(long long)", referenced from: QAVPlayerPrivate::doStep(PendingMediaStatus, bool) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::played(long long)", referenced from: QAVPlayerPrivate::doStep(PendingMediaStatus, bool) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::seeked(long long)", referenced from: QAVPlayerPrivate::doStep(PendingMediaStatus, bool) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::stepped(long long)", referenced from: QAVPlayerPrivate::doStep(PendingMediaStatus, bool) in libQtAVPlayer.a[2](qavplayer.cpp.o) "QAVPlayer::stopped(long long)", referenced from: QAVPlayerPrivate::doStep(PendingMediaStatus, bool) in libQtAVPlayer.a[2](qavplayer.cpp.o) "vtable for QAVAudioOutput", referenced from: QAVAudioOutput::QAVAudioOutput(QObject*) in libQtAVPlayer.a[30](qavaudiooutput.cpp.o) QAVAudioOutput::~QAVAudioOutput() in libQtAVPlayer.a[30](qavaudiooutput.cpp.o) NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for QAVAudioOutputDevice", referenced from: QAVAudioOutputDevice::QAVAudioOutputDevice(QObject*) in libQtAVPlayer.a[31](qavaudiooutputdevice.cpp.o) NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for QAVPlayer", referenced from: QAVPlayer::QAVPlayer(QObject*) in libQtAVPlayer.a[2](qavplayer.cpp.o) NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

LiveVideoPlayer is my custom C++ code that worked fine so far. It is a thin wrapper to QtAvPlayer, URL to file code: https://pastebin.com/7HDErnd5

@valbok
Copy link
Owner

valbok commented May 29, 2024

Thanks for contribution!

I just tested:

qml_video % mkdir build
qml_video % cd build
build % cmake ../ -DQT_AVPLAYER_MULTIMEDIA=ON -DCMAKE_PREFIX_PATH=/opt/Qt/6.7.1/macos/lib/cmake -DCMAKE_LIBRARY_PATH=/opt/homebrew/Cellar/ffmpeg/7.0_1/lib
build % make -j8

And it worked. Could you please compare https://github.com/valbok/QtAVPlayer/blob/master/examples/qml_video/CMakeLists.txt with your cmake?

@chetan-prime
Copy link
Author

No problem @valbok, glad if it helped in any way.
The compilation of QtAvplayer as a static library(on ios) against 6.7.1 works fine for me & I then copy the headers, library into the Qt 6.7.1 folders.

But the issue comes when I include the QtAvplayer headers & library in my Qt 6.7.1 project. That gives the above errors during linking. This used to work fine on 6.7.0.

@mxnt10
Copy link
Contributor

mxnt10 commented May 30, 2024

Isso deve ser um problema específico do macos. No Arch Linux compila bem com a versão 6.7.1 e ficou até melhor que a versão 6.5.2 do meu sistema.

@valbok
Copy link
Owner

valbok commented May 31, 2024

I used the latest version along with 'QtAVPlayer.cmake' including inside it. It compiles fine but while linking the final binary for ios, we get these errors:

Did you try to compile https://github.com/valbok/QtAVPlayer/blob/master/examples/qml_video/CMakeLists.txt ?

@valbok
Copy link
Owner

valbok commented May 31, 2024

Oh, you might forgot to provide -DQT_AVPLAYER_MULTIMEDIA=ON during cmake?
Maybe not, since it should prevent from compiling.

@valbok
Copy link
Owner

valbok commented Jul 7, 2024

Feel free to reopen if you have still issues.

@valbok valbok closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants