Hi,
I am trying to upgrade some old open sourced project and I get plenty of errors.
I trying to join some sections of code with the errors
‘initializing’: cannot convert from ‘std::unique_ptr<juce::FileOutputStream,std::default_deletejuce::FileOutputStream>’ to ‘juce::FileOutputStream *’
‘nonexistent’: is not a member of ‘juce::File’
‘nonexistent’: undeclared identifier
‘initializing’: cannot convert from ‘std::unique_ptr<juce::FileInputStream,std::default_deletejuce::FileInputStream>’ to ‘juce::FileInputStream *’
‘nonexistent’: is not a member of ‘juce::File’
‘nonexistent’: undeclared identifier
‘initializing’: cannot convert from ‘std::unique_ptr<juce::FileOutputStream,std::default_deletejuce::FileOutputStream>’ to ‘juce::FileOutputStream *’
‘juce::startThread’: no overloaded function could convert all the argument types
‘initializing’: cannot convert from ‘std::unique_ptr<juce::FileInputStream,std::default_deletejuce::FileInputStream>’ to ‘juce::FileInputStream’
binary ‘!’: no operator found which takes a left-hand operand of type ‘juce::FileInputStream’ (or there is no acceptable conversion)
built-in operator ‘!’ cannot be applied to an operand of type ‘juce::FileInputStream’
type ‘juce::FileInputStream’ does not have an overloaded member ‘operator ->’
‘->juce::FileInputStream::isExhausted’: left operand has ‘class’ type, use ‘.’
type ‘juce::FileInputStream’ does not have an overloaded member ‘operator ->’
‘->juce::FileInputStream::getTotalLength’: left operand has ‘class’ type, use ‘.’
type ‘juce::FileInputStream’ does not have an overloa
It looks like a lot of these errors are due to return types of functions changing from raw pointers to std::unique_ptr. I guess the code is calling File::getOutputStream(), but the return type of this function changed in 2020 to return a std::unique_ptr<FileOutputStream> instead of FileOutputStream*. You can get access to the raw pointer managed by a unique_ptr by calling get() on it.
Of course
I am engineer and my last course of C++ was 10 years ago. Maybe the frame have changed a little bit but I will learn.
Thanks you to show me the firsts step.
I will come back when I will make few steps further.
Thanks !