Skip to content

fix:build on ubuntu22.04 Qt5.12.12 error: ‘std::function’ has not bee… #5

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

Closed
wants to merge 1 commit into from

Conversation

IanVzs
Copy link

@IanVzs IanVzs commented Aug 30, 2022

OS: Ubuntu 22.04
Qt: 5.12.12
cmake version 3.22.1

build error:
[ 40%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/decoder/videobuffer.cpp.o
In file included from /home/ian/Desktop/QtScrcpy/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:1:
/home/ian/Desktop/QtScrcpy/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.h:38:33: error: ‘std::function’ has not been declared
38 | void peekRenderedFrame(std::function<void(int width, int height, uint8_t* dataRGB32)> onFrame);
| ^~~~~~~~
/home/ian/Desktop/QtScrcpy/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.h:38:41: error: expected ‘,’ or ‘...’ before ‘<’ token
38 | void peekRenderedFrame(std::function<void(int width, int height, uint8_t* dataRGB32)> onFrame);
| ^
/home/ian/Desktop/QtScrcpy/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:110:6: error: variable or field ‘peekRenderedFrame’ declared void
110 | void VideoBuffer::peekRenderedFrame(std::function<void(int width, int height, uint8_t* dataRGB32)> onFrame)
| ^~~~~~~~~~~
/home/ian/Desktop/QtScrcpy/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:110:42: error: ‘function’ is not a member of ‘std’
110 | void VideoBuffer::peekRenderedFrame(std::function<void(int width, int height, uint8_t* dataRGB32)> onFrame)
| ^~~~~~~~
/home/ian/Desktop/QtScrcpy/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:8:1: note: ‘std::function’ is defined in header ‘’; did you forget to ‘#include ’?
7 | #include "libavutil/imgutils.h"
+++ |+#include
8 | }
/home/ian/Desktop/QtScrcpy/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:110:97: error: expression list treated as compound expression in functional cast [-fpermissive]

@re2zero
Copy link
Contributor

re2zero commented Sep 13, 2022

I think this is same build issue with #4 , the root cause is the header 'function1' did not be included.

@barry-ran barry-ran closed this Sep 13, 2022
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

Successfully merging this pull request may close these issues.

3 participants