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

Windows build error 'realm::property': no matching overloaded function found #124

Closed
adamski opened this issue Dec 1, 2023 · 2 comments
Closed

Comments

@adamski
Copy link

adamski commented Dec 1, 2023

This schema seems to cause a build issue on Windows.

Compiler used is Visual Studio 17 2022

this is with 0.4.0.

struct TonalDBKey
{
    // This is because we can't have a vector of optional types in Realm.
    std::optional<int64_t>     degree = std::nullopt;
    std::optional<int64_t>     period = std::nullopt;
    std::optional<std::string> name;
};
REALM_EMBEDDED_SCHEMA (TonalDBKey, degree, period, name)

struct TonalDBMapping
{
    bool                     customKeyMap = false;
    std::string              noteLayout = std::string (magic_enum::enum_name (tonaldb::NoteLayout::chromatic));
    int64_t                  referenceNote = 69;
    double                   referenceFrequency = 440.0;
    int64_t                  rootNote = 60;
    std::vector<TonalDBKey*> keyMap = {};
};
REALM_EMBEDDED_SCHEMA (TonalDBMapping, customKeyMap, noteLayout, referenceNote, referenceFrequency, rootNote, keyMap)

That last line starting with REALM_EMBEDDED_SCHEMA is line 38.

C:\Gitlab-Runner\builds\s-QzEZ_-a\1\entonal-studio\entonal-studio\Source\Database\TonalDB.cpp(38,1): error C2672: 'realm::property': no matching overloaded function found [C:\Gitlab-Runner\builds\s-QzEZ_-a\1\entonal-studio\entonal-studio\entonal-studio-cbd4218a\Source\Database\TonalDB.vcxproj]
C:\Gitlab-Runner\CPM\Cache\cpprealm\82861d8f148f882c91383ed93f0449af70b35891\src\cpprealm/schema.hpp(368,27): message : could be 'auto realm::property(const char *)' [C:\Gitlab-Runner\builds\s-QzEZ_-a\1\entonal-studio\entonal-studio\entonal-studio-cbd4218a\Source\Database\TonalDB.vcxproj]
C:\Gitlab-Runner\builds\s-QzEZ_-a\1\entonal-studio\entonal-studio\Source\Database\TonalDB.cpp(38,1): message : 'realm::property': too many template arguments [C:\Gitlab-Runner\builds\s-QzEZ_-a\1\entonal-studio\entonal-studio\entonal-studio-cbd4218a\Source\Database\TonalDB.vcxproj]
C:\Gitlab-Runner\builds\s-QzEZ_-a\1\entonal-studio\entonal-studio\Source\Database\TonalDB.cpp(38,1): error C3615: constexpr function 'realm::schema' cannot result in a constant expression [C:\Gitlab-Runner\builds\s-QzEZ_-a\1\entonal-studio\entonal-studio\entonal-studio-cbd4218a\Source\Database\TonalDB.vcxproj]
C:\Gitlab-Runner\CPM\Cache\cpprealm\82861d8f148f882c91383ed93f0449af70b35891\src\cpprealm/schema.hpp(395,43): message : failure was caused by an uninitialized variable declaration [C:\Gitlab-Runner\builds\s-QzEZ_-a\1\entonal-studio\entonal-studio\entonal-studio-cbd4218a\Source\Database\TonalDB.vcxproj]
  INTERNAL COMPILER ERROR in 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX64\x64\CL.exe'
      Please choose the Technical Support command on the Visual C++
      Help menu, or open the Technical Support help file for more information
@adamski adamski changed the title Windows build error VS 2022 Windows build error 'realm::property': no matching overloaded function found Dec 1, 2023
@leemaguire
Copy link
Contributor

Hi @adamski did you configure your projects CMakeLists.txt to have the following:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:preprocessor /bigobj")

as seen in the Windows example here

@adamski
Copy link
Author

adamski commented Dec 2, 2023

Looks like I missed that thanks

@adamski adamski closed this as completed Dec 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants