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

<video_player> Compilation error #95

Open
JGNS opened this issue Jan 5, 2024 · 6 comments
Open

<video_player> Compilation error #95

JGNS opened this issue Jan 5, 2024 · 6 comments
Labels
question Further information is requested

Comments

@JGNS
Copy link

JGNS commented Jan 5, 2024

Sorry to bother you again, I couldn't compile when integrating the video playback function. Here are some instructions for my project:

  1. Add dependencies:
    video_player: ^2.8.2
    video_player_elinux:
    git:
    url: https://github.com/sony/flutter-elinux-plugins.git
    path: packages/video_player
    Ref: main
  2. Before adding dependencies, I can compile the product normally and execute it on the embedded device. The command used is: flutter-elinux build elinux --target-backend-type=x11 --target-arch=arm64, and I am in Added set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++-10) to elinux/CmakeLists.txt.
  3. I have asked similar questions before(<video player> compilation error #93 ), but I am a newbie, what should I do?too difficult.
@JGNS
Copy link
Author

JGNS commented Jan 5, 2024

if i add set(CMAKE_CXX_COMPILER /usr/bin/clang) to CMakeLists.txt,The following error will occur during compilation(also use flutter-elinux build elinux --target-backend-type=x11 --target-arch=arm64):

Failed to cmake build:
Scanning dependencies of target flutter_assemble
[ 0%] Built target flutter_assemble
Scanning dependencies of target flutter_wrapper_plugin
Scanning dependencies of target flutter_wrapper_app
[ 7%] Building CXX object flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/core_implementations.cc.o
[ 15%] Building CXX object flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/standard_codec.cc.o
[ 23%] Building CXX object flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/plugin_registrar.cc.o
[ 30%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/standard_codec.cc.o
[ 38%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/core_implementations.cc.o
[ 46%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/flutter_view_controller.cc.o
[ 53%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/flutter_engine.cc.o

/home/yone/Desktop/demo/elinux/flutter/ephemeral/cpp_client_wrapper/core_implementations.cc:16:10: fatal error: 'cassert' file not found
#include
^~~~~~~~~
1 error generated.
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_plugin.dir/build.make:63:flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/core_implementations.cc.o] 错误 1
make[2]: *** 正在等待未完成的任务....
/home/yone/Desktop/demo/elinux/flutter/ephemeral/cpp_client_wrapper/standard_codec.cc:10:10: fatal error: 'cassert' file not found
#include
^~~~~~~~~
1 error generated.
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_plugin.dir/build.make:76:flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/standard_codec.cc.o] 错误 1
In file included from /home/yone/Desktop/demo/elinux/flutter/ephemeral/cpp_client_wrapper/plugin_registrar.cc:5:
/home/yone/Desktop/demo/elinux/flutter/ephemeral/cpp_client_wrapper/include/flutter/plugin_registrar.h:10:10: fatal error: 'map' file not found
#include
^~~~~
1 error generated.
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_plugin.dir/build.make:89:flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/plugin_registrar.cc.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:172:flutter/CMakeFiles/flutter_wrapper_plugin.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
/home/yone/Desktop/demo/elinux/flutter/ephemeral/cpp_client_wrapper/core_implementations.cc:16:10: fatal error: 'cassert' file not found
#include
^~~~~~~~~
/home/yone/Desktop/demo/elinux/flutter/ephemeral/cpp_client_wrapper/standard_codec.cc:10:10: fatal error: 'cassert' file not found
#include
^~~~~~~~~
1 error generated.
1 error generated.
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_app.dir/build.make:76:flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/standard_codec.cc.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_app.dir/build.make:63:flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/core_implementations.cc.o] 错误 1
In file included from /home/yone/Desktop/demo/elinux/flutter/ephemeral/cpp_client_wrapper/flutter_view_controller.cc:5:
/home/yone/Desktop/demo/elinux/flutter/ephemeral/cpp_client_wrapper/include/flutter/flutter_view_controller.h:10:10: fatal error: 'memory' file not found
#include
^~~~~~~~
In file included from /home/yone/Desktop/demo/elinux/flutter/ephemeral/cpp_client_wrapper/flutter_engine.cc:5:
/home/yone/Desktop/demo/elinux/flutter/ephemeral/cpp_client_wrapper/include/flutter/flutter_engine.h:10:10: fatal error: 'chrono' file not found
#include
^~~~~~~~
1 error generated.
1 error generated.
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_app.dir/build.make:89:flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/flutter_engine.cc.o] 错误 1
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_app.dir/build.make:102:flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/flutter_view_controller.cc.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:145:flutter/CMakeFiles/flutter_wrapper_app.dir/all] 错误 2
make: *** [Makefile:130:all] 错误 2

what should i do?thanks.

@HidenoriMatsubayashi
Copy link
Collaborator

Please try --system-include-directories option.

e.g.
--system-include-directories=/usr/aarch64-linux-gnu/include/c++/${version}/aarch64-linux-gnu

@HidenoriMatsubayashi HidenoriMatsubayashi added the question Further information is requested label Jan 6, 2024
@JGNS
Copy link
Author

JGNS commented Jan 8, 2024

Please try --system-include-directories option.

e.g. --system-include-directories=/usr/aarch64-linux-gnu/include/c++/${version}/aarch64-linux-gnu

thank you for your reply. Here is some specific information:

  1. In elinux/CmakeLists.txt I added set(CMAKE_CXX_COMPILER /usr/bin/clang).
  2. Execute in the terminal: flutter-elinux build elinux --target-backend-type=x11 --target-arch=arm64 --system-include-directories=/usr/aarch64-linux-gnu/include/c++/10/aarch64-linux-gnu.

The error message is as follows:
Failed to cmake build:
Scanning dependencies of target flutter_assemble
[ 0%] Built target flutter_assemble
Scanning dependencies of target flutter_wrapper_plugin
Scanning dependencies of target flutter_wrapper_app
[ 6%] Building CXX object flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/core_implementations.cc.o
[ 12%] Building CXX object flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/standard_codec.cc.o
[ 18%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/standard_codec.cc.o
[ 25%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/core_implementations.cc.o
[ 31%] Building CXX object flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/flutter_engine.cc.o

/home/yone/Desktop/demo_nolibs/elinux/flutter/ephemeral/cpp_client_wrapper/core_implementations.cc:16:10: fatal error: 'cassert' file not found
#include
^~~~~~~~~
/home/yone/Desktop/demo_nolibs/elinux/flutter/ephemeral/cpp_client_wrapper/standard_codec.cc/home/yone/Desktop/demo_nolibs/elinux/flutter/ephemeral/cpp_client_wrapper/standard_codec.cc:10:10: fatal
error: 'cassert' file not found
#include
^~~~~~~~~
:10:10: fatal error: 'cassert' file not found
#include
^~~~~~~~~
/home/yone/Desktop/demo_nolibs/elinux/flutter/ephemeral/cpp_client_wrapper/core_implementations.cc:16:10: fatal error: 'cassert' file not found
#include
^~~~~~~~~
1 error generated.
1 error generated.
1 error generated.
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_plugin.dir/build.make:63:flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/core_implementations.cc.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_app.dir/build.make:76:flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/standard_codec.cc.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_plugin.dir/build.make:76:flutter/CMakeFiles/flutter_wrapper_plugin.dir/ephemeral/cpp_client_wrapper/standard_codec.cc.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:193:flutter/CMakeFiles/flutter_wrapper_plugin.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
1 error generated.
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_app.dir/build.make:63:flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/core_implementations.cc.o] 错误 1
In file included from /home/yone/Desktop/demo_nolibs/elinux/flutter/ephemeral/cpp_client_wrapper/flutter_engine.cc:5:
/home/yone/Desktop/demo_nolibs/elinux/flutter/ephemeral/cpp_client_wrapper/include/flutter/flutter_engine.h:10:10: fatal error: 'chrono' file not found
#include
^~~~~~~~
1 error generated.
make[2]: *** [flutter/CMakeFiles/flutter_wrapper_app.dir/build.make:89:flutter/CMakeFiles/flutter_wrapper_app.dir/ephemeral/cpp_client_wrapper/flutter_engine.cc.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:166:flutter/CMakeFiles/flutter_wrapper_app.dir/all] 错误 2
make: *** [Makefile:130:all] 错误 2

but if i execute in root: find -name cassert
output is :
...
./usr/aarch64-linux-gnu/include/c++/10/cassert
./usr/aarch64-linux-gnu/include/c++/8/cassert
./usr/lib/llvm-10/include/c++/v1/cassert
./usr/include/c++/9/cassert
./usr/include/c++/10/cassert
...

Thanks for your help.

@HidenoriMatsubayashi
Copy link
Collaborator

In elinux/CmakeLists.txt I added set(CMAKE_CXX_COMPILER /usr/bin/clang).

This shouldn't be necessary.

Unfortunately, I have no suggestions, and it's generally challenging to resolve cross-building issues on other systems because we don't share a common build environment

Please see https://github.com/sony/flutter-elinux/wiki/Building-flutter-apps#cross-building-from-x64-to-arm64.

@HidenoriMatsubayashi
Copy link
Collaborator

Also, please ensure that target rootfs should be used correctly when you do cross-building.

@JGNS
Copy link
Author

JGNS commented Jan 8, 2024

In elinux/CmakeLists.txt I added set(CMAKE_CXX_COMPILER /usr/bin/clang).

This shouldn't be necessary.

Unfortunately, I have no suggestions, and it's generally challenging to resolve cross-building issues on other systems because we don't share a common build environment

Please see https://github.com/sony/flutter-elinux/wiki/Building-flutter-apps#cross-building-from-x64-to-arm64.

Very strange thing: the program doesn't compile without adding this
(set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=gold")
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++-10)):

Failed to cmake:
-- The CXX compiler identification is Clang 10.0.0
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- broken
-- Configuring incomplete, errors occurred!
See also "/home/yone/Desktop/demo/build/elinux/arm64/release/CMakeFiles/CMakeOutput.log".
See also "/home/yone/Desktop/demo/build/elinux/arm64/release/CMakeFiles/CMakeError.log".

CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
The C++ compiler

 "/usr/bin/clang++"

is not able to compile a simple test program.
Failed to cmake:
-- The CXX compiler identification is Clang 10.0.0
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- broken
-- Configuring incomplete, errors occurred!
See also "/home/yone/Desktop/demo/build/elinux/arm64/release/CMakeFiles/CMakeOutput.log".
See also "/home/yone/Desktop/demo/build/elinux/arm64/release/CMakeFiles/CMakeError.log".

CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
The C++ compiler

 "/usr/bin/clang++"

is not able to compile a simple test program.

If add this, without integrating the video function, it can be compiled and run normally on the target device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants