-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix: build failed with Qt5.11 and GCC8.3. #4
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the header ‘<functional>’ was include QDebug, if miss include functional or Debug, it would error: ‘std::function’ has not been declared. Log: fix build failed issue.
build error logs: :~/work/demo/scrcpy/QtScrcpy-new/build$ cmake ..
-- [QtScrcpy] Project QtScrcpy 0.0.0
-- [QtScrcpy] CPU_ARCH:x64
-- [QtScrcpy] BUILD_TYPE:RelWithDebInfo
-- [QtScrcpy] C++ compiler ID is: GNU
-- [QtScrcpy] Set warnings as error
-- [QtScrcpy] Qt version is: 5.11
-- multi config:QC_IS_MUTIL_CONFIG
-- [QtScrcpy] QSC_CPU_ARCH:x64
-- [QtScrcpyCore] QSC_DEPLOY_PATH: /home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/../output/x64/RelWithDebInfo/$<0:>
-- Configuring done
-- Generating done
-- Build files have been written to: /home/doll/work/demo/scrcpy/QtScrcpy-new/build
doll@doll-PC:~/work/demo/scrcpy/QtScrcpy-new/build$ make
[ 2%] Automatic MOC and UIC for target QtScrcpyCore
[ 2%] Built target QtScrcpyCore_autogen
[ 4%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/QtScrcpyCore_autogen/mocs_compilation.cpp.o
[ 6%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/adb/adbprocessimpl.cpp.o
[ 9%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/adb/adbprocess.cpp.o
[ 11%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/device.cpp.o
[ 13%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/controller/controller.cpp.o
[ 15%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/controller/bufferutil.cpp.o
[ 18%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/controller/inputconvert/inputconvertbase.cpp.o
[ 20%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/controller/inputconvert/inputconvertnormal.cpp.o
[ 22%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/controller/inputconvert/inputconvertgame.cpp.o
[ 25%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/controller/inputconvert/controlmsg.cpp.o
[ 27%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/controller/inputconvert/keymap/keymap.cpp.o
[ 29%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/controller/receiver/devicemsg.cpp.o
[ 31%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/controller/receiver/receiver.cpp.o
[ 34%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/decoder/avframeconvert.cpp.o
[ 36%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/decoder/decoder.cpp.o
[ 38%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/decoder/fpscounter.cpp.o
[ 40%] Building CXX object QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/decoder/videobuffer.cpp.o
In file included from /home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:1:
/home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.h:38:33: error: ‘std::function’ has not been declared
void peekRenderedFrame(std::function<void(int width, int height, uint8_t* dataRGB32)> onFrame);
^~~~~~~~
/home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.h:38:41: error: expected ‘,’ or ‘...’ before ‘<’ token
void peekRenderedFrame(std::function<void(int width, int height, uint8_t* dataRGB32)> onFrame);
^
/home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:110:42: error: variable or field ‘peekRenderedFrame’ declared void
void VideoBuffer::peekRenderedFrame(std::function<void(int width, int height, uint8_t* dataRGB32)> onFrame)
^~~~~~~~
/home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:110:42: error: ‘function’ is not a member of ‘std’
/home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:110:42: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
/home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:8:1:
+#include <functional>
}
/home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:110:42:
void VideoBuffer::peekRenderedFrame(std::function<void(int width, int height, uint8_t* dataRGB32)> onFrame)
^~~~~~~~
/home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:110:97: error: expression list treated as compound expression in functional cast [-fpermissive]
void VideoBuffer::peekRenderedFrame(std::function<void(int width, int height, uint8_t* dataRGB32)> onFrame)
^
/home/doll/work/demo/scrcpy/QtScrcpy-new/QtScrcpy/QtScrcpyCore/src/device/decoder/videobuffer.cpp:110:51: error: expected primary-expression before ‘void’
void VideoBuffer::peekRenderedFrame(std::function<void(int width, int height, uint8_t* dataRGB32)> onFrame)
^~~~
cc1plus: error: unrecognized command line option ‘-Wno-c++17-extensions’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-nested-anon-types’ [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/build.make:300:QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/src/device/decoder/videobuffer.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:170:QtScrcpy/QtScrcpyCore/CMakeFiles/QtScrcpyCore.dir/all] 错误 2
make: *** [Makefile:91:all] 错误 2 In order to clear the highlight editing warning in Qt creator, I add '' in these header files. |
barry-ran
added a commit
that referenced
this pull request
May 11, 2024
fix: build failed with Qt5.11 and GCC8.3.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
the header ‘’ was included QDebug, if miss include functional or Debug, it would error: ‘std::function’ has not been declared.
Log: fix build failed issue.