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

build: improve the Linux aspect of things #75

Merged
merged 2 commits into from Aug 29, 2022

Conversation

Tachi107
Copy link
Contributor

@Tachi107 Tachi107 commented Aug 26, 2022

This is still a work in progress, and is likely going to conflict with #9 (Cc: @Zopolis4)

With this PR I aim at making Cemu's build script more compatible with how Linux operates, so this mainly means that system dependencies will be used when possible.

I'll split the changes in different commits on purpose, so please don't squash this on merge.

Could potentially fix #1.

@Tachi107 Tachi107 force-pushed the build-linux branch 2 times, most recently from 47c3662 to f0c8e63 Compare August 26, 2022 17:20
@Tachi107
Copy link
Contributor Author

Putting this on hold until #78 is resolved.

@Exzap
Copy link
Contributor

Exzap commented Aug 27, 2022

Can you set ENABLE_VCPKG to ON by default on all platforms. Its the recommended way of building. After that I can merge

@Tachi107
Copy link
Contributor Author

Can you set ENABLE_VCPKG to ON by default on all platforms. Its the recommended way of building. After that I can merge

Sure. But note that this is not ready yet.

@Tachi107
Copy link
Contributor Author

Here's the error I'm currently facing:

/usr/bin/clang++  -fuse-ld=lld -Wl,-error-limit=0 src/CMakeFiles/CemuBin.dir/main.cpp.o src/CMakeFiles/CemuBin.dir/mainLLE.cpp.o -o bin/Cemu  src/audio/libCemuAudio.a  src/Cafe/libCemuCafe.a  src/Common/libCemuCommon.a  src/Cemu/libCemuComponents.a  src/config/libCemuConfig.a  src/gui/libCemuGui.a  src/input/libCemuInput.a  src/util/libCemuUtil.a  src/asm/libCemuAsm.a  /usr/lib/x86_64-linux-gnu/libssl.so  /usr/lib/x86_64-linux-gnu/libcrypto.so  /usr/lib/x86_64-linux-gnu/libz.so  /usr/lib/x86_64-linux-gnu/libcurl.so  /usr/lib/x86_64-linux-gnu/libpugixml.a  /usr/lib/x86_64-linux-gnu/libSDL2main.a  src/imgui/libimguiImpl.a  src/resource/libCemuResource.a  src/audio/libCemuAudio.a  src/Cafe/libCemuCafe.a  src/Common/libCemuCommon.a  src/Cemu/libCemuComponents.a  src/config/libCemuConfig.a  src/gui/libCemuGui.a  src/input/libCemuInput.a  src/util/libCemuUtil.a  src/imgui/libimguiImpl.a  src/resource/libCemuResource.a  src/asm/libCemuAsm.a  /usr/lib/x86_64-linux-gnu/libpng16.so  /usr/lib/x86_64-linux-gnu/libz.so  /usr/lib/x86_64-linux-gnu/libSPIRV.a  -lSPIRV-Tools-opt  -lSPIRV-Tools  -lSPIRV-Tools-link  /usr/lib/x86_64-linux-gnu/libglslang.a  /usr/lib/x86_64-linux-gnu/libMachineIndependent.a  /usr/lib/x86_64-linux-gnu/libOGLCompiler.a  /usr/lib/x86_64-linux-gnu/libOSDependent.a  /usr/lib/x86_64-linux-gnu/libGenericCodeGen.a  dependencies/ih264d/libih264d.a  /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.74.0  /usr/lib/x86_64-linux-gnu/libXrender.so  /usr/lib/x86_64-linux-gnu/libX11.so  /usr/lib/x86_64-linux-gnu/libssl.so  /usr/lib/x86_64-linux-gnu/libcrypto.so  dependencies/discord-rpc/src/libdiscord-rpc.a  -lpthread  /usr/lib/x86_64-linux-gnu/libcubeb.so.0.0.0  dependencies/ZArchive/libzarchive.a  /usr/lib/x86_64-linux-gnu/libzstd.so  /usr/lib/x86_64-linux-gnu/libzip.so.4.0  /usr/lib/x86_64-linux-gnu/libSDL2.so  /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.74.0  /usr/lib/x86_64-linux-gnu/libGLX.so  -L/usr/lib/x86_64-linux-gnu  -pthread  -lwx_gtk3u_xrc-3.2  -lwx_gtk3u_html-3.2  -lwx_gtk3u_qa-3.2  -lwx_gtk3u_core-3.2  -lwx_baseu_xml-3.2  -lwx_baseu_net-3.2  -lwx_baseu-3.2  /usr/lib/x86_64-linux-gnu/libEGL.so  /usr/lib/x86_64-linux-gnu/libOpenGL.so  /usr/lib/x86_64-linux-gnu/libboost_nowide.so.1.74.0  /usr/lib/x86_64-linux-gnu/libimgui.a  /usr/lib/x86_64-linux-gnu/libstb.so  /usr/lib/x86_64-linux-gnu/libpugixml.so.1.12
ld.lld: error: undefined symbol: wxPropertyGridNameStr
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxPropertyGrid::wxPropertyGrid(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxStringProperty::wxStringProperty(wxString const&, wxString const&, wxString const&)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a
>>> referenced 1 more times

ld.lld: error: undefined symbol: wxPropertyGridInterface::Append(wxPGProperty*)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a
>>> referenced 3 more times

ld.lld: error: undefined symbol: wxPropertyGridInterface::SetPropertyReadOnly(wxPGPropArgCls const&, bool, int)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxPGChoices::Add(wxString const&, int)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxEnumProperty::wxEnumProperty(wxString const&, wxString const&, wxPGChoices&, int)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxEVT_PG_CHANGED
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::AddAccountPage(wxNotebook*)) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxPGProperty::GetName() const
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::OnAccountSettingsChanged(wxPropertyGridEvent&)) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::OnAccountSettingsChanged(wxPropertyGridEvent&)) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::OnAccountSettingsChanged(wxPropertyGridEvent&)) in archive src/gui/libCemuGui.a
>>> referenced 2 more times

ld.lld: error: undefined symbol: wxPGProperty::SetValueFromString(wxString const&, int)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::UpdateAccountInformation()) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::UpdateAccountInformation()) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::UpdateAccountInformation()) in archive src/gui/libCemuGui.a
>>> referenced 1 more times

ld.lld: error: undefined symbol: wxPGProperty::SetChoiceSelection(int)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::UpdateAccountInformation()) in archive src/gui/libCemuGui.a
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::UpdateAccountInformation()) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: typeinfo for wxPGProperty
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::UpdateAccountInformation()) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: typeinfo for wxEnumProperty
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(GeneralSettings2::UpdateAccountInformation()) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxPGChoices::Init()
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(wxPGChoices::wxPGChoices()) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxPGChoices::Free()
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(wxPGChoices::~wxPGChoices()) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxPropertyGrid::DoSetSplitterPosition(int, int, int)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(wxPropertyGrid::SetSplitterPosition(int, int)) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxPGProperty::SetValue(wxVariant, wxVariant*, int)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(wxPGProperty::SetValueToUnspecified()) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxPropertyGridIteratorBase::Next(bool)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(wxPGIterator<wxPGProperty, wxPropertyGridPageState>::operator++()) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxPropertyGridInterface::GetPropertyByName(wxString const&) const
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(wxPropertyGridInterface::GetProperty(wxString const&) const) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxPropertyGridIteratorBase::Init(wxPropertyGridPageState*, int, wxPGProperty*, int)
>>> referenced by GeneralSettings2.cpp
>>>               GeneralSettings2.cpp.o:(wxPGIterator<wxPGProperty, wxPropertyGridPageState>::wxPGIterator(wxPropertyGridPageState*, int, wxPGProperty*, int)) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxGLCanvas::wxGLCanvas(wxWindow*, int, int const*, wxPoint const&, wxSize const&, long, wxString const&, wxPalette const&)
>>> referenced by OpenGLCanvas.cpp
>>>               OpenGLCanvas.cpp.o:(OpenGLCanvas::OpenGLCanvas(wxWindow*, wxSize const&, bool)) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxGLContext::wxGLContext(wxGLCanvas*, wxGLContext const*, wxGLContextAttrs const*)
>>> referenced by OpenGLCanvas.cpp
>>>               OpenGLCanvas.cpp.o:(OpenGLCanvas::OpenGLCanvas(wxWindow*, wxSize const&, bool)) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxGLCanvasEGL::~wxGLCanvasEGL()
>>> referenced by OpenGLCanvas.cpp
>>>               OpenGLCanvas.cpp.o:(wxGLCanvas::~wxGLCanvas()) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxGLCanvas::GetClassInfo() const
>>> referenced by OpenGLCanvas.cpp
>>>               OpenGLCanvas.cpp.o:(vtable for OpenGLCanvas) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxGLCanvasEGL::IsShownOnScreen() const
>>> referenced by OpenGLCanvas.cpp
>>>               OpenGLCanvas.cpp.o:(vtable for OpenGLCanvas) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxGLCanvas::SetBackgroundStyle(wxBackgroundStyle)
>>> referenced by OpenGLCanvas.cpp
>>>               OpenGLCanvas.cpp.o:(vtable for OpenGLCanvas) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxGLCanvas::GTKHandleRealized()
>>> referenced by OpenGLCanvas.cpp
>>>               OpenGLCanvas.cpp.o:(vtable for OpenGLCanvas) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxGLCanvasEGL::SwapBuffers()
>>> referenced by OpenGLCanvas.cpp
>>>               OpenGLCanvas.cpp.o:(vtable for OpenGLCanvas) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: wxGLCanvas::GetXWindow() const
>>> referenced by OpenGLCanvas.cpp
>>>               OpenGLCanvas.cpp.o:(vtable for OpenGLCanvas) in archive src/gui/libCemuGui.a

ld.lld: error: undefined symbol: typeinfo for wxGLCanvas
>>> referenced by OpenGLCanvas.cpp
>>>               OpenGLCanvas.cpp.o:(typeinfo for OpenGLCanvas) in archive src/gui/libCemuGui.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@abouvier
Copy link
Contributor

abouvier commented Aug 27, 2022

Maybe don't use the find module from CMake (used by default if both find and config modules are present), but force the config file from the wxWidgets package?

And... more problems :p

@robertkirkman
Copy link

abouvier's cemu-git AUR package, which as I understand it also adds a build method that does not require vcpkg just like this PR, builds and runs well for me on Arch Linux.
On the same system (using the same dependencies and environment that work for cemu-git), building https://github.com/Tachi107/Cemu/tree/build-linux following the directions posted by Tachi107 in #1 results in errors corresponding to the 3 problems abouvier just mentioned. After manually editing the CMake files to resolve them and starting a new build, I see this:

Details

FAILED: src/gui/CMakeFiles/CemuGui.dir/GameUpdateWindow.cpp.o 
/usr/lib/ccache/bin/clang++ -DENABLE_DISCORD_RPC -DHAS_CUBEB=1 -DVK_NO_PROTOTYPES -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -DWXUSINGDLL -D__WXGTK3__ -D__WXGTK__ -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/build/src/gui -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/dependencies/Vulkan-Headers/include -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui/.. -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/audio/.. -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/Cafe/.. -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/Common/.. -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/Cemu/.. -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/config/.. -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/input/.. -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/resource/.. -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/util/.. -I/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/dependencies/ZArchive/include -isystem /usr/lib/wx/include/gtk3-unicode-3.2 -isystem /usr/include/wx-3.2 -fms-extensions -fms-compatibility-version=19.14 -fdelayed-template-parsing -maes -Wno-switch -Wno-ignored-attributes -Wno-deprecated-enum-enum-conversion -Wno-ambiguous-reversed-operator -pthread -std=gnu++20 -Winvalid-pch -Xclang -include-pch -Xclang /run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/build/src/gui/CMakeFiles/CemuGui.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/build/src/gui/CMakeFiles/CemuGui.dir/cmake_pch.hxx -MD -MT src/gui/CMakeFiles/CemuGui.dir/GameUpdateWindow.cpp.o -MF src/gui/CMakeFiles/CemuGui.dir/GameUpdateWindow.cpp.o.d -o src/gui/CMakeFiles/CemuGui.dir/GameUpdateWindow.cpp.o -c /run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui/GameUpdateWindow.cpp
/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui/GameUpdateWindow.cpp:66:47: error: call to consteval function 'fmt::basic_format_string<char, std::basic_string<char> &, std::basic_string<char> &>::basic_format_string<std::basic_string<char>, 0>' is not a constant expression
                                        wxMessageDialog dialog(this, fmt::format(wxMsg, typeStrCurrentlyInstalled, typeStrToInstall), _("Warning"), wxCENTRE | wxYES_NO | wxICON_EXCLAMATION);
                                                                                 ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/basic_string.h:234:16: note: read of non-constexpr variable 'wxMsg' is not allowed in a constant expression
      { return _M_dataplus._M_p; }
               ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/basic_string.h:2568:16: note: in call to '&wxMsg->_M_data()'
      { return _M_data(); }
               ^
/usr/include/fmt/core.h:483:17: note: in call to '&wxMsg->data()'
      : data_(s.data()),
                ^
/usr/include/fmt/core.h:3057:62: note: in call to 'basic_string_view(wxMsg)'
  FMT_CONSTEVAL FMT_INLINE basic_format_string(const S& s) : str_(s) {
                                                             ^
/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui/GameUpdateWindow.cpp:66:47: note: in call to 'basic_format_string(wxMsg)'
                                        wxMessageDialog dialog(this, fmt::format(wxMsg, typeStrCurrentlyInstalled, typeStrToInstall), _("Warning"), wxCENTRE | wxYES_NO | wxICON_EXCLAMATION);
                                                                                 ^
/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui/GameUpdateWindow.cpp:65:18: note: declared here
                                        std::string wxMsg = wxHelper::MakeUTF8(_("It seems that there is already a title installed at the target location but it has a different type.\nCurrently installed: \'{}\' Installing: \'{}\'\n\nThis can happen for titles which were installed with very old Cemu versions.\nDo you still want to continue with the installation? It will replace the currently installed title."));
                                                    ^
In file included from /run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui/GameUpdateWindow.cpp:10:
/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui/../gui/helpers/wxHelpers.h:51:21: error: call to consteval function 'fmt::basic_format_string<char, std::basic_string<char>>::basic_format_string<std::basic_string<char>, 0>' is not a constant expression
        return fmt::format(format.ToStdString(), std::forward<TArgs>(args)...);
                           ^
/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui/GameUpdateWindow.cpp:95:29: note: in instantiation of function template specialization 'wxStringFormat2<std::basic_string<char>>' requested here
                                        const auto error_msg = wxStringFormat2(_("Error when trying to move former title installation:\n{}"), GetSystemErrorMessage(ec));
                                                               ^
/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui/../gui/helpers/wxHelpers.h:51:21: note: function parameter 'format' with unknown value cannot be used in a constant expression
        return fmt::format(format.ToStdString(), std::forward<TArgs>(args)...);
                           ^
/run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/src/gui/../gui/helpers/wxHelpers.h:48:42: note: declared here
wxString wxStringFormat2(const wxString& format, TArgs&&...args)
                                         ^
2 errors generated.

@Tachi107
Copy link
Contributor Author

@robertkirkman what version of fmt are you using?

@robertkirkman
Copy link

robertkirkman commented Aug 27, 2022

@robertkirkman what version of fmt are you using?

On Arch Linux we have both fmt and fmt7, the latter of which installs in /opt and abouvier specifies using -DCMAKE_CXX_FLAGS_INIT="-I/opt/fmt7/include". Rebuilding your version using these commands instead:

CC=clang CXX=clang++ cmake -G Ninja -B build -DENABLE_VCPKG=false -DCMAKE_CXX_FLAGS_INIT="-I/opt/fmt7/include"
cmake --build build

progresses further, and then fails with this, which might be equivalent to the error you posted:

Details

FAILED: /run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/bin/Cemu 
: && /usr/lib/ccache/bin/clang++ -I/opt/fmt7/include  src/CMakeFiles/CemuBin.dir/main.cpp.o src/CMakeFiles/CemuBin.dir/mainLLE.cpp.o -o /run/media/tacokoneko/ATOM/chroots/cemu-tachi/Cemu/bin/Cemu  src/audio/libCemuAudio.a  src/Cafe/libCemuCafe.a  src/Common/libCemuCommon.a  src/Cemu/libCemuComponents.a  src/config/libCemuConfig.a  src/gui/libCemuGui.a  src/input/libCemuInput.a  src/util/libCemuUtil.a  src/asm/libCemuAsm.a  /usr/lib/libssl.so  /usr/lib/libcrypto.so  /usr/lib/libz.so  /usr/lib/libcurl.so  /usr/lib/libSDL2main.a  src/imgui/libimguiImpl.a  src/resource/libCemuResource.a  src/audio/libCemuAudio.a  src/Cafe/libCemuCafe.a  src/Common/libCemuCommon.a  src/Cemu/libCemuComponents.a  src/config/libCemuConfig.a  src/gui/libCemuGui.a  src/input/libCemuInput.a  src/util/libCemuUtil.a  src/imgui/libimguiImpl.a  src/resource/libCemuResource.a  src/asm/libCemuAsm.a  /usr/lib/libpng16.so  /usr/lib/libz.so  /usr/lib/libSPIRV.a  /usr/lib/libMachineIndependent.a  /usr/lib/libOGLCompiler.a  /usr/lib/libOSDependent.a  /usr/lib/libGenericCodeGen.a  dependencies/ih264d/libih264d.a  /usr/lib/libboost_filesystem.so.1.79.0  /usr/lib/libboost_atomic.so.1.79.0  /usr/lib/libXrender.so  /usr/lib/libX11.so  /usr/lib/libssl.so  /usr/lib/libcrypto.so  dependencies/discord-rpc/src/libdiscord-rpc.a  -lpthread  /usr/lib/libcubeb.so.0.0.0  dependencies/ZArchive/libzarchive.a  /usr/lib/libzstd.so  /usr/lib/libzip.so.5.5  /usr/lib/libSDL2-2.0.so.0.2500.0  /usr/lib/libboost_program_options.so.1.79.0  -pthread  -lwx_gtk3u_xrc-3.2  -lwx_gtk3u_html-3.2  -lwx_gtk3u_qa-3.2  -lwx_gtk3u_core-3.2  -lwx_baseu_xml-3.2  -lwx_baseu_net-3.2  -lwx_baseu-3.2  /usr/lib/libboost_nowide.so.1.79.0  /usr/lib/libimgui.so  /usr/lib/libpugixml.so.1.12  /usr/lib/libGLX.so  /usr/lib/libOpenGL.so && :
/usr/bin/ld: src/gui/libCemuGui.a(OpenGLCanvas.cpp.o): in function `OpenGLCanvas::OpenGLCanvas(wxWindow*, wxSize const&, bool)':
OpenGLCanvas.cpp:(.text._ZN12OpenGLCanvasC2EP8wxWindowRK6wxSizeb[_ZN12OpenGLCanvasC2EP8wxWindowRK6wxSizeb]+0xb3): undefined reference to `wxGLCanvas::wxGLCanvas(wxWindow*, int, int const*, wxPoint const&, wxSize const&, long, wxString const&, wxPalette const&)'
/usr/bin/ld: OpenGLCanvas.cpp:(.text._ZN12OpenGLCanvasC2EP8wxWindowRK6wxSizeb[_ZN12OpenGLCanvasC2EP8wxWindowRK6wxSizeb]+0x141): undefined reference to `wxGLContext::wxGLContext(wxGLCanvas*, wxGLContext const*, wxGLContextAttrs const*)'
/usr/bin/ld: src/gui/libCemuGui.a(OpenGLCanvas.cpp.o): in function `wxGLCanvas::~wxGLCanvas()':
OpenGLCanvas.cpp:(.text._ZN10wxGLCanvasD2Ev[_ZN10wxGLCanvasD2Ev]+0x11): undefined reference to `wxGLCanvasEGL::~wxGLCanvasEGL()'
/usr/bin/ld: src/gui/libCemuGui.a(OpenGLCanvas.cpp.o):(.data.rel.ro._ZTV12OpenGLCanvas[_ZTV12OpenGLCanvas]+0x20): undefined reference to `wxGLCanvas::GetClassInfo() const'
/usr/bin/ld: src/gui/libCemuGui.a(OpenGLCanvas.cpp.o):(.data.rel.ro._ZTV12OpenGLCanvas[_ZTV12OpenGLCanvas]+0x210): undefined reference to `wxGLCanvasEGL::IsShownOnScreen() const'
/usr/bin/ld: src/gui/libCemuGui.a(OpenGLCanvas.cpp.o):(.data.rel.ro._ZTV12OpenGLCanvas[_ZTV12OpenGLCanvas]+0x380): undefined reference to `wxGLCanvas::SetBackgroundStyle(wxBackgroundStyle)'
/usr/bin/ld: src/gui/libCemuGui.a(OpenGLCanvas.cpp.o):(.data.rel.ro._ZTV12OpenGLCanvas[_ZTV12OpenGLCanvas]+0x638): undefined reference to `wxGLCanvas::GTKHandleRealized()'
/usr/bin/ld: src/gui/libCemuGui.a(OpenGLCanvas.cpp.o):(.data.rel.ro._ZTV12OpenGLCanvas[_ZTV12OpenGLCanvas]+0x690): undefined reference to `wxGLCanvasEGL::SwapBuffers()'
/usr/bin/ld: src/gui/libCemuGui.a(OpenGLCanvas.cpp.o):(.data.rel.ro._ZTV12OpenGLCanvas[_ZTV12OpenGLCanvas]+0x6a8): undefined reference to `wxGLCanvas::GetXWindow() const'
/usr/bin/ld: src/gui/libCemuGui.a(OpenGLCanvas.cpp.o):(.data.rel.ro._ZTI12OpenGLCanvas[_ZTI12OpenGLCanvas]+0x28): undefined reference to `typeinfo for wxGLCanvas'
/usr/bin/ld: src/gui/libCemuGui.a(GeneralSettings2.cpp.o): in function `GeneralSettings2::AddAccountPage(wxNotebook*)':
GeneralSettings2.cpp:(.text+0x14519): undefined reference to `wxPropertyGridNameStr'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x14563): undefined reference to `wxPropertyGrid::wxPropertyGrid(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x1468c): undefined reference to `wxStringProperty::wxStringProperty(wxString const&, wxString const&, wxString const&)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x146ab): undefined reference to `wxPropertyGridInterface::Append(wxPGProperty*)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x147d4): undefined reference to `wxPropertyGridInterface::SetPropertyReadOnly(wxPGPropArgCls const&, bool, int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x148be): undefined reference to `wxStringProperty::wxStringProperty(wxString const&, wxString const&, wxString const&)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x148dd): undefined reference to `wxPropertyGridInterface::Append(wxPGProperty*)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x14a8e): undefined reference to `wxStringProperty::wxStringProperty(wxString const&, wxString const&, wxString const&)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x14aad): undefined reference to `wxPropertyGridInterface::Append(wxPGProperty*)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x14b63): undefined reference to `wxPGChoices::Add(wxString const&, int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x14c04): undefined reference to `wxPGChoices::Add(wxString const&, int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x14caf): undefined reference to `wxEnumProperty::wxEnumProperty(wxString const&, wxString const&, wxPGChoices&, int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x14cce): undefined reference to `wxPropertyGridInterface::Append(wxPGProperty*)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x14dc1): undefined reference to `wxStringProperty::wxStringProperty(wxString const&, wxString const&, wxString const&)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x14de0): undefined reference to `wxPropertyGridInterface::Append(wxPGProperty*)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x14ee2): undefined reference to `wxPGChoices::Add(wxString const&, int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x15a9b): undefined reference to `wxEnumProperty::wxEnumProperty(wxString const&, wxString const&, wxPGChoices&, int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x15aba): undefined reference to `wxPropertyGridInterface::Append(wxPGProperty*)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x15b30): undefined reference to `wxEVT_PG_CHANGED'
/usr/bin/ld: src/gui/libCemuGui.a(GeneralSettings2.cpp.o): in function `GeneralSettings2::OnAccountSettingsChanged(wxPropertyGridEvent&)':
GeneralSettings2.cpp:(.text+0x17d62): undefined reference to `wxPGProperty::GetName() const'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x17f0a): undefined reference to `wxPGProperty::GetName() const'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x18392): undefined reference to `wxPGProperty::GetName() const'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x1844f): undefined reference to `wxPGProperty::GetName() const'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x185ba): undefined reference to `wxPGProperty::GetName() const'
/usr/bin/ld: src/gui/libCemuGui.a(GeneralSettings2.cpp.o): in function `GeneralSettings2::UpdateAccountInformation()':
GeneralSettings2.cpp:(.text+0x1ed4a): undefined reference to `wxPGProperty::SetValueFromString(wxString const&, int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x1ee0b): undefined reference to `wxPGProperty::SetValueFromString(wxString const&, int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x1efea): undefined reference to `wxPGProperty::SetValueFromString(wxString const&, int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x1f089): undefined reference to `wxPGProperty::SetChoiceSelection(int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x1f12d): undefined reference to `wxPGProperty::SetValueFromString(wxString const&, int)'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x1f196): undefined reference to `typeinfo for wxPGProperty'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x1f19d): undefined reference to `typeinfo for wxEnumProperty'
/usr/bin/ld: GeneralSettings2.cpp:(.text+0x1f43a): undefined reference to `wxPGProperty::SetChoiceSelection(int)'
/usr/bin/ld: src/gui/libCemuGui.a(GeneralSettings2.cpp.o): in function `wxPGChoices::wxPGChoices()':
GeneralSettings2.cpp:(.text._ZN11wxPGChoicesC2Ev[_ZN11wxPGChoicesC2Ev]+0x11): undefined reference to `wxPGChoices::Init()'
/usr/bin/ld: src/gui/libCemuGui.a(GeneralSettings2.cpp.o): in function `wxPGChoices::~wxPGChoices()':
GeneralSettings2.cpp:(.text._ZN11wxPGChoicesD2Ev[_ZN11wxPGChoicesD2Ev]+0x11): undefined reference to `wxPGChoices::Free()'
/usr/bin/ld: src/gui/libCemuGui.a(GeneralSettings2.cpp.o): in function `wxPropertyGrid::SetSplitterPosition(int, int)':
GeneralSettings2.cpp:(.text._ZN14wxPropertyGrid19SetSplitterPositionEii[_ZN14wxPropertyGrid19SetSplitterPositionEii]+0x22): undefined reference to `wxPropertyGrid::DoSetSplitterPosition(int, int, int)'
/usr/bin/ld: src/gui/libCemuGui.a(GeneralSettings2.cpp.o): in function `wxPGProperty::SetValueToUnspecified()':
GeneralSettings2.cpp:(.text._ZN12wxPGProperty21SetValueToUnspecifiedEv[_ZN12wxPGProperty21SetValueToUnspecifiedEv]+0x6d): undefined reference to `wxPGProperty::SetValue(wxVariant, wxVariant*, int)'
/usr/bin/ld: src/gui/libCemuGui.a(GeneralSettings2.cpp.o): in function `wxPGIterator<wxPGProperty, wxPropertyGridPageState>::operator++()':
GeneralSettings2.cpp:(.text._ZN12wxPGIteratorI12wxPGProperty23wxPropertyGridPageStateEppEv[_ZN12wxPGIteratorI12wxPGProperty23wxPropertyGridPageStateEppEv]+0x1a): undefined reference to `wxPropertyGridIteratorBase::Next(bool)'
/usr/bin/ld: src/gui/libCemuGui.a(GeneralSettings2.cpp.o): in function `wxPropertyGridInterface::GetProperty(wxString const&) const':
GeneralSettings2.cpp:(.text._ZNK23wxPropertyGridInterface11GetPropertyERK8wxString[_ZNK23wxPropertyGridInterface11GetPropertyERK8wxString]+0x19): undefined reference to `wxPropertyGridInterface::GetPropertyByName(wxString const&) const'
/usr/bin/ld: src/gui/libCemuGui.a(GeneralSettings2.cpp.o): in function `wxPGIterator<wxPGProperty, wxPropertyGridPageState>::wxPGIterator(wxPropertyGridPageState*, int, wxPGProperty*, int)':
GeneralSettings2.cpp:(.text._ZN12wxPGIteratorI12wxPGProperty23wxPropertyGridPageStateEC2EPS1_iPS0_i[_ZN12wxPGIteratorI12wxPGProperty23wxPropertyGridPageStateEC2EPS1_iPS0_i]+0x3c): undefined reference to `wxPropertyGridIteratorBase::Init(wxPropertyGridPageState*, int, wxPGProperty*, int)'
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

@Tachi107
Copy link
Contributor Author

progresses further, and then fails with this, which might be equivalent to the error you posted:

Yes, the error is the same. @abouvier, any clue?

@Tachi107
Copy link
Contributor Author

Maybe don't use the find module from CMake (used by default if both find and config modules are present), but force the config file from the wxWidgets package?

wxWidgets has a Config file only if built with CMake, but it is not its default build system and thus not widely available. I'll add an extra check for the Config file though.

  • imgui package can have CMake config files but no pc file

Oh, I've just discovered that imgui doesn't have a canonical build system, so every distro does things differently... I'll try to find a solution to this.

Thanks, I'll fix this too.

Please fix this in Arch, the exported target should be named glm::glm

@bbaster
Copy link

bbaster commented Aug 27, 2022

Getting this error while trying to run cmake:

-- Checking for one of the modules 'imgui'
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find imgui (missing: imgui_LINK_LIBRARIES imgui_FOUND) (found
  version "")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  cmake/Findimgui.cmake:14 (find_package_handle_standard_args)
  CMakeLists.txt:73 (find_package)

Did anyone manage to build with this branch on Arch? I do have the imgui AUR package installed, maybe it's related to imgui not having a "pc file"?

@robertkirkman
Copy link

Getting this error while trying to run cmake

To get to the same point as the others (wxwidgets link errors), I did this: https://clbin.com/n1R7j, then compiled with the arguments I mentioned above. Note that this is a "on the fly" edit just for Arch Linux that isn't good for anything else.

@Tachi107
Copy link
Contributor Author

wxWidgets has a Config file only if built with CMake, but it is not its default build system and thus not widely available. I'll add an extra check for the Config file though.

Check added. Could you check if this fixes the build for you?

@robertkirkman
Copy link

robertkirkman commented Aug 27, 2022

Check added. Could you check if this fixes the build for you?

I tried both ed4331b and 501e920 and (after applying the mentioned patch) both of them fail with the same error that begins with "undefined reference to wxGLCanvas".

here is a full paths list for the current releases of wxwidgets-gtk3 + wxwidgets-common on Arch Linux https://clbin.com/JfMZA, there is /usr/lib/cmake/wxWidgets/wxWidgetsConfig.cmake which has a lot of content but I am not sure how helpful this might be.

@Tachi107
Copy link
Contributor Author

I think I now understand why the linking is failing... The FindwxWidgets module is not passing the needed linking flags.

On my system it is passing -lwx_gtk3u_xrc-3.2, -lwx_gtk3u_html-3.2, -lwx_gtk3u_qa-3.2, -lwx_gtk3u_core-3.2, -lwx_baseu_xml-3.2, -lwx_baseu_net-3.2, and -lwx_baseu-3.2, while it should also pass -lwx_gtk3u_gl-3.2 and -lwx_gtk3u_propgrid-3.2.

This should be fixed in the latest commit.

@robertkirkman
Copy link

robertkirkman commented Aug 27, 2022

Unfortunately 7b851bc is still failing for me with the same error. I am updating with git pull origin build-linux and building with rm -rf build and then the same cmake commands above.

@Tachi107
Copy link
Contributor Author

Unfortunately 7b851bc is still failing for me with the same error. I am updating with git pull origin build-linux and building with rm -rf build and then the same cmake commands above.

Does your system ship a CMake Config file for wxWidgets? If so, it is possible that you also have to explicitly link to wx::gl and wx::propgrid. I'll look into this tomorrow

@robertkirkman
Copy link

robertkirkman commented Aug 27, 2022

Does your system ship a CMake Config file for wxWidgets? If so, it is possible that you also have to explicitly link to wx::gl and wx::propgrid. I'll look into this tomorrow

based on your suggestion I executed find . -type f -exec sed -i 's/wx::core wx::base/wx::core wx::base wx::gl wx::propgrid/g' {} + in the repository directory and compiled again, this time the build compiled and linked successfully.
Executing the bin/Cemu resulting from this works, and the UI buttons and windows work.
On the first attempt to launch a game using this binary (BOTW), it crashed with this error:

Details

SIGSEGV!
Error: signal 11:
bin/Cemu(+0x8e829d)[0x5613160ce29d]
/usr/lib/libc.so.6(+0x38a40)[0x7f0546051a40]
/usr/lib/libimgui.so(+0x61b5f)[0x7f05466a1b5f]
/usr/lib/libimgui.so(+0x62643)[0x7f05466a2643]
/usr/lib/libimgui.so(+0x728e9)[0x7f05466b28e9]
/usr/lib/libimgui.so(_ZN11ImFontAtlas18GetTexDataAsAlpha8EPPhPiS2_S2_+0x5e)[0x7f05466afe1e]
/usr/lib/libimgui.so(_ZN11ImFontAtlas18GetTexDataAsRGBA32EPPhPiS2_S2_+0x98)[0x7f05466afec8]
bin/Cemu(+0xc3041d)[0x56131641641d]
bin/Cemu(+0x39cde0)[0x561315b82de0]
bin/Cemu(+0x8943d3)[0x56131607a3d3]
bin/Cemu(+0x894712)[0x56131607a712]
bin/Cemu(+0x88632f)[0x56131606c32f]
bin/Cemu(+0x886d6b)[0x56131606cd6b]
bin/Cemu(+0x31dfe8)[0x561315b03fe8]
bin/Cemu(+0x2a6367)[0x561315a8c367]
bin/Cemu(+0x2a62fd)[0x561315a8c2fd]
bin/Cemu(+0x2a62d5)[0x561315a8c2d5]
bin/Cemu(+0x2a62a5)[0x561315a8c2a5]
bin/Cemu(+0x2a6239)[0x561315a8c239]
/usr/lib/libstdc++.so.6(+0xd62f3)[0x7f05462d62f3]
/usr/lib/libc.so.6(+0x8678d)[0x7f054609f78d]
/usr/lib/libc.so.6(__clone+0x44)[0x7f05461208e4]
terminate called without an active exception
Aborted (core dumped)

I ran the binary again without recompiling and on the second attempt, the game launch was successful and I am in-game. This is the first time I've noticed a build without vcpkg working in-game, very good job with this work

@Tachi107
Copy link
Contributor Author

@robertkirkman could you confirm me that with 534a6ac the build links successfully?

@robertkirkman
Copy link

robertkirkman commented Aug 27, 2022

@robertkirkman could you confirm me that with 534a6ac the build links successfully?

working around only fmt7/imgui/pugixml/glm, it does link successfully now and can launch games as well

@Tachi107

This comment was marked as resolved.

target_link_libraries(CemuBin PRIVATE pugixml pugixml::static pugixml::pugixml)
target_link_libraries(CemuBin PRIVATE SDL2::SDL2 SDL2::SDL2main) # is SDL2main needed?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to remove SDL2::SDL2main on Gentoo to get past this line.

src/CMakeLists.txt Outdated Show resolved Hide resolved
@Tatsh
Copy link

Tatsh commented Aug 28, 2022

Right now fmt version incompatibility is the biggest issue. It is not possible (or worth it) to downgrade.

Tatsh added a commit to Tatsh/tatsh-overlay that referenced this pull request Aug 28, 2022
@robertkirkman
Copy link

I'm sorry, it took me some time to find and test build settings that are exactly the same between the two branches in the two repositories, but get as far as possible in the build process in both, within the constraints under which the failure occurs in build-linux but not in upstream. This error is the same as the one that occurred earlier in 84c4303, but that commit requires build settings that aren't the same as the newer commits to get to the same point in the build process, so I decided it's more concise and understandable to just show the results of the newest commits.

  • Failed -DENABLE_VCPKG=true build using most recent build-linux branch
rm -rf ~/.cache/vcpkg
git clone --recursive https://github.com/Tachi107/Cemu.git cemu-tachi-af636db
cd cemu-tachi-af636db/
git checkout af636db
git submodule update --init --recursive
git apply -v ../RendererShaderVk.patch
git apply -v ../CemuLogging.patch
CC=clang CXX=clang++ cmake -G Ninja -B build -DENABLE_VCPKG=true -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=bin
cmake --build build
Result of above

FAILED: src/util/CMakeFiles/CemuUtil.dir/Zir/EmitterGLSL/ZpIREmitGLSL.cpp.o 
/usr/bin/clang++ -DBOOST_NOWIDE_DYN_LINK -DBOOST_NOWIDE_NO_LIB -DENABLE_DISCORD_RPC -DHAS_CUBEB=1 -DVK_NO_PROTOTYPES -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -D_UNICODE -D__WXGTK3__ -D__WXGTK__ -I/home/rita/chroots/cemu-tachi-af636db/build/src/util -I/home/rita/chroots/cemu-tachi-af636db/src/util -I/home/rita/chroots/cemu-tachi-af636db/dependencies/Vulkan-Headers/include -I/home/rita/chroots/cemu-tachi-af636db/src/util/.. -I/home/rita/chroots/cemu-tachi-af636db/src/Common/.. -I/home/rita/chroots/cemu-tachi-af636db/src/config/.. -isystem /home/rita/chroots/cemu-tachi-af636db/build/vcpkg_installed/x64-linux/lib/wx/include/gtk3-unicode-static-3.2 -isystem /home/rita/chroots/cemu-tachi-af636db/build/vcpkg_installed/x64-linux/include/wx-3.2 -fms-extensions -fpermissive -maes -Wno-ambiguous-reversed-operator -Wno-switch -Wno-ignored-attributes -Wno-deprecated-enum-enum-conversion -std=gnu++20 -Winvalid-pch -Xclang -include-pch -Xclang /home/rita/chroots/cemu-tachi-af636db/build/src/util/CMakeFiles/CemuUtil.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/rita/chroots/cemu-tachi-af636db/build/src/util/CMakeFiles/CemuUtil.dir/cmake_pch.hxx -MD -MT src/util/CMakeFiles/CemuUtil.dir/Zir/EmitterGLSL/ZpIREmitGLSL.cpp.o -MF src/util/CMakeFiles/CemuUtil.dir/Zir/EmitterGLSL/ZpIREmitGLSL.cpp.o.d -o src/util/CMakeFiles/CemuUtil.dir/Zir/EmitterGLSL/ZpIREmitGLSL.cpp.o -c /home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: error: call to consteval function 'fmt::basic_format_string<char, int, char>::basic_format_string<const char *, 0>' is not a constant expression
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:295:9: note: in instantiation of function template specialization 'DualStringBuffer::appendFmt<int, char>' requested here
                        buf->appendFmt("uf_remappedVS[{}].{}", index/4, g_idx_to_element[index&3]);
                             ^
/usr/include/fmt/core.h:3057:67: note: function parameter 'format_str' with unknown value cannot be used in a constant expression
  FMT_CONSTEVAL FMT_INLINE basic_format_string(const S& s) : str_(s) {
                                                                  ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: note: in call to 'basic_format_string(format_str)'
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:35:29: note: declared here
        void appendFmt(const char* format_str, Args... args)
                                   ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: error: call to consteval function 'fmt::basic_format_string<char, unsigned short, char>::basic_format_string<const char *, 0>' is not a constant expression
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:309:9: note: in instantiation of function template specialization 'DualStringBuffer::appendFmt<unsigned short, char>' requested here
                        buf->appendFmt("attrDataSem{}.{}", attributeIndex, g_idx_to_element[channelIndex]);
                             ^
/usr/include/fmt/core.h:3057:67: note: function parameter 'format_str' with unknown value cannot be used in a constant expression
  FMT_CONSTEVAL FMT_INLINE basic_format_string(const S& s) : str_(s) {
                                                                  ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: note: in call to 'basic_format_string(format_str)'
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:35:29: note: declared here
        void appendFmt(const char* format_str, Args... args)
                                   ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: error: call to consteval function 'fmt::basic_format_string<char, unsigned short>::basic_format_string<const char *, 0>' is not a constant expression
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:341:9: note: in instantiation of function template specialization 'DualStringBuffer::appendFmt<unsigned short>' requested here
                        buf->appendFmt("passParameterSem{} = vec4(", attributeIndex);
                             ^
/usr/include/fmt/core.h:3057:67: note: function parameter 'format_str' with unknown value cannot be used in a constant expression
  FMT_CONSTEVAL FMT_INLINE basic_format_string(const S& s) : str_(s) {
                                                                  ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: note: in call to 'basic_format_string(format_str)'
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:35:29: note: declared here
        void appendFmt(const char* format_str, Args... args)
                                   ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: error: call to consteval function 'fmt::basic_format_string<char, unsigned int>::basic_format_string<const char *, 0>' is not a constant expression
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:399:10: note: in instantiation of function template specialization 'DualStringBuffer::appendFmt<unsigned int>' requested here
                                buf->appendFmt("{}", constDef->value_u32);
                                     ^
/usr/include/fmt/core.h:3057:67: note: function parameter 'format_str' with unknown value cannot be used in a constant expression
  FMT_CONSTEVAL FMT_INLINE basic_format_string(const S& s) : str_(s) {
                                                                  ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: note: in call to 'basic_format_string(format_str)'
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:35:29: note: declared here
        void appendFmt(const char* format_str, Args... args)
                                   ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: error: call to consteval function 'fmt::basic_format_string<char, int>::basic_format_string<const char *, 0>' is not a constant expression
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:404:10: note: in instantiation of function template specialization 'DualStringBuffer::appendFmt<int>' requested here
                                buf->appendFmt("{}", constDef->value_s32);
                                     ^
/usr/include/fmt/core.h:3057:67: note: function parameter 'format_str' with unknown value cannot be used in a constant expression
  FMT_CONSTEVAL FMT_INLINE basic_format_string(const S& s) : str_(s) {
                                                                  ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: note: in call to 'basic_format_string(format_str)'
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:35:29: note: declared here
        void appendFmt(const char* format_str, Args... args)
                                   ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: error: call to consteval function 'fmt::basic_format_string<char, float>::basic_format_string<const char *, 0>' is not a constant expression
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:409:10: note: in instantiation of function template specialization 'DualStringBuffer::appendFmt<float>' requested here
                                buf->appendFmt("{}", constDef->value_f32);
                                     ^
/usr/include/fmt/core.h:3057:67: note: function parameter 'format_str' with unknown value cannot be used in a constant expression
  FMT_CONSTEVAL FMT_INLINE basic_format_string(const S& s) : str_(s) {
                                                                  ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:38:33: note: in call to 'basic_format_string(format_str)'
                char* r = fmt::format_to(buf, format_str, std::forward<Args>(args)...);
                                              ^
/home/rita/chroots/cemu-tachi-af636db/src/util/Zir/EmitterGLSL/ZpIREmitGLSL.cpp:35:29: note: declared here
        void appendFmt(const char* format_str, Args... args)
                                   ^
6 errors generated.
[457/473] Building CXX object src/imgui/CMakeFiles/imguiImpl.dir/imgui_impl_vulkan.cpp.o
In file included from /home/rita/chroots/cemu-tachi-af636db/src/imgui/imgui_impl_vulkan.cpp:48:
In file included from /home/rita/chroots/cemu-tachi-af636db/src/imgui/../Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h:5:
In file included from /home/rita/chroots/cemu-tachi-af636db/src/imgui/../Cafe/HW/Latte/Renderer/Vulkan/LatteTextureVk.h:7:
/home/rita/chroots/cemu-tachi-af636db/src/imgui/../Cafe/HW/Latte/Renderer/Vulkan/VKRBase.h:53:2: warning: non-void function does not return a value [-Wreturn-type]
        }
        ^
1 warning generated.
[462/473] Building CXX object src/input/CMakeFiles/CemuInput.dir/InputManager.cpp.o
ninja: build stopped: subcommand failed.

  • Successful -DENABLE_VCPKG=true build using upstream
rm -rf ~/.cache/vcpkg
git clone --recursive https://github.com/cemu-project/Cemu.git cemu-exzap-454b587
cd cemu-exzap-454b587/
git checkout 454b587
git submodule update --init --recursive
git apply -v ../RendererShaderVk.patch
git apply -v ../CemuLogging.patch
CC=clang CXX=clang++ cmake -G Ninja -B build -DENABLE_VCPKG=true -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=bin
cmake --build build

Result of above: successful build and link

RendererShaderVk.patch

diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp
index 8dc6c57..aebaaf3 100644
--- a/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp
+++ b/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp
@@ -127,7 +127,7 @@ const TBuiltInResource DefaultTBuiltInResource = {
 	/* .maxDualSourceDrawBuffersEXT = */ 1,
 #endif
 
-	/* .limits = */ {
+	/* .limits = */ 
 	/* .nonInductiveForLoops = */ 1,
 	/* .whileLoops = */ 1,
 	/* .doWhileLoops = */ 1,
@@ -137,7 +137,7 @@ const TBuiltInResource DefaultTBuiltInResource = {
 	/* .generalSamplerIndexing = */ 1,
 	/* .generalVariableIndexing = */ 1,
 	/* .generalConstantMatrixVectorIndexing = */ 1
-	}
+	
 };
 
 class _ShaderVkThreadPool
@@ -466,4 +466,4 @@ void RendererShaderVk::ShaderCacheLoading_end()
 {
 	// keep g_spirvCache open since we will write to it while the game is running
 	s_isLoadingShadersVk = false;
-}
\ No newline at end of file
+}

CemuLogging.patch

diff --git a/src/Cemu/Logging/CemuLogging.h b/src/Cemu/Logging/CemuLogging.h
index 021055d..832dd4c 100644
--- a/src/Cemu/Logging/CemuLogging.h
+++ b/src/Cemu/Logging/CemuLogging.h
@@ -58,9 +58,6 @@ bool cemuLog_log(LogType type, TFmt format, TArgs&&... args)
 	if (!cemuLog_isLoggingEnabled(type))
 		return false;
 
-	const auto format_view = fmt::to_string_view(format);
-	const auto text = fmt::vformat(format_view, fmt::make_args_checked<TArgs...>(format_view, args...));
-	cemuLog_log(type, std::basic_string_view(text.data(), text.size()));
 	return true;
 }
 

@Tachi107
Copy link
Contributor Author

Tachi107 commented Aug 28, 2022

@robertkirkman thanks for your really detailed build logs.

It really seems that your build is using fmt 9. Do you have it installed on your system? I'm starting to think that the issue is that I forgot to add fmt::fmt to the list of required dependencies of a few targets, and the compiler is automatically using the headers from /usr/include.

I'll try to check if this is the case.

Edit: yeah, it seems that fmt::fmt hasn't been linked anywhere

$ grep --recursive fmt::fmt
dependencies/vcpkg_overlay_ports/fmt/usage:    target_link_libraries(main PRIVATE fmt::fmt)
dependencies/vcpkg_overlay_ports/fmt/usage:    target_link_libraries(main PRIVATE fmt::fmt-header-only)

Edit 2: addressed in 3a3cff9

@Tachi107
Copy link
Contributor Author

Thanks to 0f24b06 the glslang issues should be now gone (hopefully)

@robertkirkman
Copy link

It really seems that your build is using fmt 9. Do you have it installed on your system?

on Arch Linux there is fmt 8.1 which is required by many packages and often can't be safely uninstalled, and it is installed in /usr, while there is also fmt7 available in a separate package, which when used is installed in /opt/fmt7 and can be used by -DENABLE_VCPKG=false builds of Cemu using -DCMAKE_CXX_FLAGS_INIT="-I/opt/fmt7/include". However, I agree that it seems like -DENABLE_VCPKG=true builds should be ignoring system all system fmt installations altogether, and entirely using the fmt from vcpkg, since that is what happens upstream and seems like the logical behavior to expect. I can confirm that after 3a3cff9 the same build settings no longer result in that error and the build compiles and links successfully.

@Tachi107
Copy link
Contributor Author

Tachi107 commented Aug 28, 2022

Awesome, thanks for the feedback! This PR is still a mess (albeit it solves some issues), but I'll soon start to clean things up and make this ready for merging.

@Tachi107 Tachi107 force-pushed the build-linux branch 3 times, most recently from 0c8fca8 to ce910ce Compare August 28, 2022 22:22
This is a big rework of how dependencies are handled internally. All the
calls to CMake functions changing directory-wide properties that were
previously used to link to external and internal dependencies have been
replaced with their "target_" counterparts. This makes it possible to
express more clearly the relationships between different targets and
should also make the build script more robust in general.

In doing this, I've also made it possible to link to system libraries if
so desired; the versioned calls to find_package() will make sure that
the found dependencies are compatible with the ones required by Cemu,
and will abort the build otherwise.

Cemu's internal targets are deeply interconnected, making it hard to
fully benefit from a target-based approach. Nonetheless, I did my best
to mark PUBLIC dependencies as such, for example when an internal target
like CemuGui exposes a dependency as part of its API, i.e. it includes
a third party header in one of its public headers.

This will significantly help with improving the build experience on
Linux, thus helping a bit with the resolution of cemu-project#1.
@Tachi107
Copy link
Contributor Author

Tachi107 commented Aug 28, 2022

This should be now ready. Compilation works with and without vcpkg (I've not worked around Arch Linux's missing glm::glm target and Gentoo's missing SDL2::SDL2main target, as they seem to be bugs in their packages and should be fixed there).

I still have some minor CMake tweaks and cleanups in my local branch, but I'm going to submit them as a separate PR.

Thanks to everyone who helped with this!

Maintainers, please see the commit message of 9fabba1 for some more information about this PR

@Tachi107 Tachi107 marked this pull request as ready for review August 28, 2022 22:52
@Anuskuss
Copy link

Gave this one a try because it's the next logical step for my own PKGBUILD but it still required some tweaks to get going. Quite a few of the "new" dependencies are AUR-only so to me it would make more sense to have them as submodules or have a mix between distro packages and vcpkg (which might already be possible, I haven't tried it yet). That's obviously out of scope, just my view on this.

Unfortunately my main benchmark game (BOTW) is a stuttery mess (it freezes for many seconds at times) but that's probably because I was reckless with my edits. Will invesitgate that tomorrow.

Anyway, besides that I still think it's ready for merging. Thanks for your work @Tachi107.

@Exzap Exzap merged commit f51a51d into cemu-project:main Aug 29, 2022
@Crementif Crementif mentioned this pull request Aug 29, 2022
@Tachi107 Tachi107 deleted the build-linux branch August 29, 2022 08:00
@YuriTheHenrique
Copy link

YuriTheHenrique commented Aug 29, 2022

I'm having linking issues with building on openSUSE Tumbleweed, can anyone helpe me?
I compiled using:

- git clone --recursive https://github.com/cemu-project/Cemu
- mkdir build && cd build
- cmake .. -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja 

cmake completed, I tried to build with ninja:

[1/1] Linking CXX executable /home/cyan/DATA/git/Cemu/bin/Cemu
FAILED: /home/cyan/DATA/git/Cemu/bin/Cemu 
: && /usr/bin/clang++-12 -O3 -DNDEBUG  src/CMakeFiles/CemuBin.dir/main.cpp.o src/CMakeFiles/CemuBin.dir/mainLLE.cpp.o -o /home/cyan/DATA/git/Cemu/bin/Cemu  src/audio/libCemuAudio.a  src/Cafe/libCemuCafe.a  src/Common/libCemuCommon.a  src/Cemu/libCemuComponents.a  src/config/libCemuConfig.a  src/gui/libCemuGui.a  src/input/libCemuInput.a  src/util/libCemuUtil.a  src/asm/libCemuAsm.a  vcpkg_installed/x64-linux/lib/libSDL2.a  vcpkg_installed/x64-linux/lib/libSDL2main.a  src/imgui/libimguiImpl.a  vcpkg_installed/x64-linux/lib/libwx_baseu-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_core-3.2.a  src/resource/libCemuResource.a  src/audio/libCemuAudio.a  src/Cafe/libCemuCafe.a  src/Common/libCemuCommon.a  src/Cemu/libCemuComponents.a  src/config/libCemuConfig.a  src/gui/libCemuGui.a  src/input/libCemuInput.a  src/util/libCemuUtil.a  src/imgui/libimguiImpl.a  src/resource/libCemuResource.a  src/asm/libCemuAsm.a  vcpkg_installed/x64-linux/lib/libSPIRV.a  vcpkg_installed/x64-linux/lib/libMachineIndependent.a  vcpkg_installed/x64-linux/lib/libOGLCompiler.a  vcpkg_installed/x64-linux/lib/libOSDependent.a  vcpkg_installed/x64-linux/lib/libGenericCodeGen.a  dependencies/ih264d/libih264d.a  vcpkg_installed/x64-linux/lib/libpng16.a  vcpkg_installed/x64-linux/lib/libboost_filesystem.a  /usr/lib64/libXrender.so  /usr/lib64/libX11.so  vcpkg_installed/x64-linux/lib/libfmt.a  dependencies/discord-rpc/src/libdiscord-rpc.a  -lpthread  dependencies/cubeb/libcubeb.a  vcpkg_installed/x64-linux/lib/libcurl.a  vcpkg_installed/x64-linux/lib/libssl.a  dependencies/ZArchive/libzarchive.a  vcpkg_installed/x64-linux/lib/libzstd.a  vcpkg_installed/x64-linux/lib/libzip.a  vcpkg_installed/x64-linux/lib/libz.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_gl-3.2.a  /usr/lib64/libGLU.so  /usr/lib64/libGLX.so  /usr/lib64/libEGL.so  /usr/lib64/libOpenGL.so  -lffi  vcpkg_installed/x64-linux/lib/libwx_gtk3u_propgrid-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_xrc-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_html-3.2.a  vcpkg_installed/x64-linux/lib/libwx_baseu_xml-3.2.a  vcpkg_installed/x64-linux/lib/libSDL2.a  -lwayland-egl  -lwayland-client  -lwayland-cursor  -lEGL  -lxkbcommon  /usr/lib64/libXss.so  /usr/lib64/libXxf86vm.so  -ldbus-1  -lrt  -Wl,--no-undefined  -pthread  vcpkg_installed/x64-linux/lib/libpugixml.a  vcpkg_installed/x64-linux/lib/libboost_program_options.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_core-3.2.a  vcpkg_installed/x64-linux/lib/libwx_baseu-3.2.a  -lc  -lm  /usr/lib64/libgtk-3.so  /usr/lib64/libgdk-3.so  -lm  /usr/lib64/libpcre.so  /usr/lib64/libffi.so  /usr/lib64/libbrotlicommon.so  /usr/lib64/libglib-2.0.so  /usr/lib64/libgobject-2.0.so  /usr/lib64/libgmodule-2.0.so  /usr/lib64/libblkid.so  /usr/lib64/libsepol.so  /usr/lib64/libdatrie.so  /usr/lib64/libXrender.so  /usr/lib64/libpthread.a  /usr/lib64/libxcb.so  /usr/lib64/libXau.so  /usr/lib64/libfreetype.so  /usr/lib64/libGL.so  /usr/lib64/libpangocairo-1.0.so  /usr/lib64/libpango-1.0.so  vcpkg_installed/x64-linux/lib/libpng16.a  /usr/lib64/libXcomposite.so  /usr/lib64/libXdamage.so  /usr/lib64/libwayland-client.so  /usr/lib64/librt.a  /usr/lib64/libdl.a  /usr/lib64/libatk-1.0.so  /usr/lib64/libcairo-gobject.so  /usr/lib64/libgdk_pixbuf-2.0.so  vcpkg_installed/x64-linux/lib/libtiff.a  vcpkg_installed/x64-linux/lib/libjpeg.a  vcpkg_installed/x64-linux/lib/liblzma.a  /usr/lib64/libatk-bridge-2.0.so  /usr/lib64/libsystemd.so  /usr/lib64/libatspi.so  /usr/lib64/libdbus-1.so  /usr/lib64/libXtst.so  /usr/lib64/libxkbcommon.so  /usr/lib64/libwayland-cursor.so  /usr/lib64/libwayland-egl.so  /usr/lib64/libepoxy.so  /usr/lib64/libpangoft2-1.0.so  /usr/lib64/libfribidi.so  /usr/lib64/libthai.so  /usr/lib64/libXft.so  /usr/lib64/libcairo.so  /usr/lib64/libpixman-1.so  /usr/lib64/libfontconfig.so  /usr/lib64/libEGL.so  /usr/lib64/libxcb-shm.so  /usr/lib64/libxcb-render.so  /usr/lib64/libharfbuzz-gobject.so  /usr/lib64/libharfbuzz.so  /usr/lib64/libbz2.so  /usr/lib64/libbrotlidec.so  /usr/lib64/libgraphite2.so  /usr/lib64/libgio-2.0.so  /usr/lib64/libmount.so  /usr/lib64/libselinux.so  /usr/lib64/libpcre2-8.so  /usr/lib64/libSM.so  /usr/lib64/libICE.so  -lm  /usr/lib64/libpcre.so  /usr/lib64/libffi.so  /usr/lib64/libbrotlicommon.so  /usr/lib64/libglib-2.0.so  /usr/lib64/libgobject-2.0.so  /usr/lib64/libgmodule-2.0.so  /usr/lib64/libblkid.so  /usr/lib64/libsepol.so  /usr/lib64/libdatrie.so  /usr/lib64/libXrender.so  /usr/lib64/libpthread.a  /usr/lib64/libxcb.so  /usr/lib64/libXau.so  /usr/lib64/libfreetype.so  /usr/lib64/libGL.so  /usr/lib64/libpangocairo-1.0.so  /usr/lib64/libpango-1.0.so  vcpkg_installed/x64-linux/lib/libpng16.a  /usr/lib64/libXcomposite.so  /usr/lib64/libXdamage.so  /usr/lib64/libwayland-client.so  /usr/lib64/librt.a  /usr/lib64/libdl.a  /usr/lib64/libatk-1.0.so  /usr/lib64/libcairo-gobject.so  /usr/lib64/libgdk_pixbuf-2.0.so  vcpkg_installed/x64-linux/lib/libtiff.a  vcpkg_installed/x64-linux/lib/libjpeg.a  vcpkg_installed/x64-linux/lib/liblzma.a  /usr/lib64/libatk-bridge-2.0.so  /usr/lib64/libsystemd.so  /usr/lib64/libatspi.so  /usr/lib64/libdbus-1.so  /usr/lib64/libXtst.so  /usr/lib64/libxkbcommon.so  /usr/lib64/libwayland-cursor.so  /usr/lib64/libwayland-egl.so  /usr/lib64/libepoxy.so  /usr/lib64/libpangoft2-1.0.so  /usr/lib64/libfribidi.so  /usr/lib64/libthai.so  /usr/lib64/libXft.so  /usr/lib64/libcairo.so  /usr/lib64/libpixman-1.so  /usr/lib64/libfontconfig.so  /usr/lib64/libEGL.so  /usr/lib64/libxcb-shm.so  /usr/lib64/libxcb-render.so  /usr/lib64/libharfbuzz-gobject.so  /usr/lib64/libharfbuzz.so  /usr/lib64/libbz2.so  /usr/lib64/libbrotlidec.so  /usr/lib64/libgraphite2.so  /usr/lib64/libgio-2.0.so  /usr/lib64/libmount.so  /usr/lib64/libselinux.so  /usr/lib64/libpcre2-8.so  /usr/lib64/libSM.so  /usr/lib64/libICE.so  vcpkg_installed/x64-linux/lib/libexpat.a  vcpkg_installed/x64-linux/lib/libz.a  /usr/lib64/libX11.so  /usr/lib64/libXcursor.so  /usr/lib64/libXinerama.so  /usr/lib64/libXi.so  /usr/lib64/libXfixes.so  /usr/lib64/libXrandr.so  /usr/lib64/libXext.so  vcpkg_installed/x64-linux/lib/libboost_nowide.a  vcpkg_installed/x64-linux/lib/libcrypto.a  -ldl  vcpkg_installed/x64-linux/lib/libimgui.a && :
/usr/bin/ld: src/CMakeFiles/CemuBin.dir/main.cpp.o: na função "std::__cxx11::basic_string<char8_t, std::char_traits<char8_t>, std::allocator<char8_t> > fmt::v7::detail::vformat<char8_t, 0>(fmt::v7::basic_string_view<char8_t>, fmt::v7::basic_format_args<fmt::v7::basic_format_context<fmt::v7::detail::buffer_appender<fmt::v7::type_identity<char8_t>::type>, fmt::v7::type_identity<char8_t>::type> >)":
main.cpp:(.text._ZN3fmt2v76detail7vformatIDuLi0EEENSt7__cxx1112basic_stringIT_St11char_traitsIS5_ESaIS5_EEENS0_17basic_string_viewIS5_EENS0_17basic_format_argsINS0_20basic_format_contextINS1_15buffer_appenderINS0_13type_identityIS5_E4typeEEESH_EEEE[_ZN3fmt2v76detail7vformatIDuLi0EEENSt7__cxx1112basic_stringIT_St11char_traitsIS5_ESaIS5_EEENS0_17basic_string_viewIS5_EENS0_17basic_format_argsINS0_20basic_format_contextINS1_15buffer_appenderINS0_13type_identityIS5_E4typeEEESH_EEEE]+0x58): referência não definida para "void std::__cxx11::basic_string<char8_t, std::char_traits<char8_t>, std::allocator<char8_t> >::_M_construct<char8_t const*>(char8_t const*, char8_t const*, std::forward_iterator_tag)"
clang-12.0: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Sorry for the big log.

@Crementif
Copy link
Member

Crementif commented Aug 29, 2022

There's was another user in our discord who had similar issues on Fedora. Would you perhaps know the reason for it @Tachi107? Is there maybe something wrong with linking to fmt from vcpkg with this commit?

@Tachi107
Copy link
Contributor Author

Tachi107 commented Aug 29, 2022 via email

@YuriTheHenrique
Copy link

@Tachi107 Yes, I'm using vcpkg, Here the logs:
CMakeOutput.log
CMakeError.log

I can try to building without vcpkg if you wish.

@kuunha
Copy link

kuunha commented Aug 30, 2022

I'm having linking issues with building on openSUSE Tumbleweed, can anyone helpe me? I compiled using:

Using clang++ (12 or 14), I had to comment these lines from "src/Cemu/Logging/CemuLogging.h":

//	const auto format_view = fmt::to_string_view(format); __
//	const auto text = fmt::vformat(format_view, fmt::make_args_checked<TArgs...>(format_view, args...));
//	cemuLog_log(type, std::basic_string_view(text.data(), text.size()));

GCC works without changes

@Tachi107
Copy link
Contributor Author

@Tachi107 Yes, I'm using vcpkg, Here the logs: CMakeOutput.log CMakeError.log

These don't look like full logs. Also, you should include CMake's console output.

I can try to building without vcpkg if you wish.

In theory building without vcpkg currently works (if dependencies are satisfied), so it shouldn't be needed.

Anyway I'm not personally interested in fixing vcpkg, nor I know enough about it to understand while it is failing. You may have better luck asking the Cemu's developers, as they say that vcpkg is the supported build method (see #107)

@Tachi107
Copy link
Contributor Author

@Tatsh I found out why on Gentoo you needed to remove SDL2::SDL2main from the list of linked libraries; the latest SDL2 release, 2.24.0, partially broke the sdl2-config.cmake file generated when building with the GNU autotools, see libsdl-org/SDL#6119.

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.

Current State Of Linux Builds
10 participants