mmatyas / pegasus-frontend

A cross platform, customizable graphical frontend for launching emulators and managing your game collection.
http://pegasus-frontend.org
Other
1.19k stars 105 forks source link

There was an error in using the embedded LUNUX QT compiler. There is no clue. Please guide! #1036

Closed SZB56 closed 1 year ago

SZB56 commented 1 year ago

I used QT5.15.5, the library and qmake generated by cross-compilation, and installed several QT components (QML and QtQuick2 according to the requirements of github :Multimedia SVG SQL (SQLite v3), but SDL2 is not used), to compile Pegasus source code. After many attempts, the following error is always prompted:

home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp: 在函数‘void {匿名}::verify_collected_files(const std::vector<model::Collection, std::allocator<model::Collection> >&, HashMap<QString, QStringList>&)’中: /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp:92:22: 错误: expected unqualified-id before ‘[’ token for (const auto& [collname, expected_files] : expected_collection_files) { ^ /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp:92:22: 错误: expected ‘;’ before ‘[’ token /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp:92:23: 错误: ‘collname’在此作用域中尚未声明 for (const auto& [collname, expected_files] : expected_collection_files) { ^~~~ /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp:92:33: 错误: ‘expected_files’在此作用域中尚未声明 for (const auto& [collname, expected_files] : expected_collection_files) { ^~~~~~ /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp: 在 lambda 函数中: /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp:92:49: 错误: expected ‘{’ before ‘:’ token for (const auto& [collname, expected_files] : expected_collection_files) { ^ /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp: 在函数‘void {匿名}::verify_collected_files(const std::vector<model::Collection, std::allocator<model::Collection> >&, HashMap<QString, QStringList>&)’中: /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp:92:49: 错误: expected ‘;’ before ‘:’ token /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp:92:49: 错误: expected primary-expression before ‘:’ token /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp:92:49: 错误: expected ‘)’ before ‘:’ token /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp:92:49: 错误: expected primary-expression before ‘:’ token /home/zanebey/pegasus-frontend/tests/backend/providers/pegasus/test_PegasusProvider.cpp:89:44: 警告: unused parameter ‘collections’ [-Wunused-parameter] const std::vector<model::Collection*>& collections,

make[4]: [Makefile:1185:test_PegasusProvider.o] 错误 1 make[4]: 离开目录“/home/zanebey/pegasus-frontend/build/tests/backend/providers/pegasus” make[3]: [Makefile:52:sub-pegasus-make_first] 错误 2 make[3]: 离开目录“/home/zanebey/pegasus-frontend/build/tests/backend/providers” make[2]: [Makefile:152:sub-providers-make_first] 错误 2 make[2]: 正在等待未完成的任务....

make[4]: 离开目录“/home/zanebey/pegasus-frontend/build/tests/backend/model/memory” make[4]: 离开目录“/home/zanebey/pegasus-frontend/build/tests/backend/model/keyeditor” make[3]: 离开目录“/home/zanebey/pegasus-frontend/build/tests/backend/model” make[2]: 离开目录“/home/zanebey/pegasus-frontend/build/tests/backend” make[1]: [Makefile:49:sub-backend-make_first] 错误 2 make[1]: 离开目录“/home/zanebey/pegasus-frontend/build/tests” make: [Makefile:99:sub-tests-make_first] 错误 2

I hope someone can give me some advice, thank you!

mmatyas commented 1 year ago

Hi! It seems your C++ compiler does not support C++17. Some of the tests use C++17 code, so you will need a more recent compiler to build the project. For example, GCC 7, Clang 5, and VS 2017 or later should all support C++17.

SZB56 commented 1 year ago

Yes, as you said, I replaced the compiler with gcc7.2 and solved this problem. Thank you very much for your guidance, thank you!