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

Error compiling juce module for c++ 17 #271

Open
alexdsp opened this issue Mar 25, 2019 · 3 comments
Open

Error compiling juce module for c++ 17 #271

alexdsp opened this issue Mar 25, 2019 · 3 comments

Comments

@alexdsp
Copy link

alexdsp commented Mar 25, 2019

I am getting a compilation error when i set the language standard in the projucer from c++14 to c++17.

C2143 syntax error: missing ',' before '<' (compiling source file ....\JuceLibraryCode\include_rosic.cpp) Test_SharedCode c:\modules\rosic\datastructures\rosic_keyvaluemap.h 34

C2143 syntax error: missing ',' before '<' (compiling source file ....\JuceLibraryCode\include_rosic.cpp) Test_SharedCode c:\modules\rosic\datastructures\rosic_keyvaluemap.h 56

@RobinSchmidt
Copy link
Owner

i don't have c++17 yet. do you know, how to fix it? then i will apply it

@alexdsp
Copy link
Author

alexdsp commented Mar 27, 2019

i didnt find a fix for that, what i ended up doing is comment out
in rosic_KeyValueMap.h lines 33- 40 and lines 55-62:

template<class KeyType, class ValueType>
struct KeyValuePairPointerLessByKey : std::binary_function<KeyValuePair<KeyType, ValueType>, KeyValuePair<KeyType, ValueType>, bool>
{
bool operator() (KeyValuePair<KeyType, ValueType>* pointer1, KeyValuePair<KeyType, ValueType>* pointer2) const
{
return keyValuePairPointerLessByKey(pointer1, pointer2);
}
};

template<class KeyType, class ValueType>
struct KeyValuePairPointerLessByValue : std::binary_function<KeyValuePair<KeyType, ValueType>, KeyValuePair<KeyType, ValueType>, bool>
{
bool operator() (KeyValuePair<KeyType, ValueType>* pointer1, KeyValuePair<KeyType, ValueType>* pointer2) const
{
return keyValuePairPointerLessByValue(pointer1, pointer2);
}
};

@RobinSchmidt
Copy link
Owner

RobinSchmidt commented Mar 28, 2019

oh - it seems to have to do with this std::binary_function which has been removed in c++17:

https://en.cppreference.com/w/cpp/utility/functional/binary_function

...so, commenting this code out works at the moment? i'm not sure, what i should use instead.. i'll figure this stuff out when moving on to c++17.

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

No branches or pull requests

2 participants