Windows builds broken with 5.4.4

I recently updated to Juce 5.4.4 and completed the changes for the deprecation of ScopedPointer but found I was still getting errors on juce_File.cpp, juce_AudioFormatManager.cpp and several other juce files. I wasn’t sure if there were still problems with my app so I created a new test audio app project and ended up getting the same errors. I’m still using VS15 but tried it with V17 and VS19 Community editions and got the same results (this is a Windows 10 machine).

The errors each generate several entries but this is the group for the juce_File.cpp file in VS19 Community: (I’ve removed my paths)

C:..\juce_File.cpp(710,1): error C2556: ‘juce::FileInputStream *juce::File::createInputStream(void) const’: overloaded function differs only by return type from ‘std::unique_ptr<juce::FileInputStream,std::default_delete<_Ty>> juce::File::createInputStream(void) const’
1>C:..\juce_File.cpp(710,1): error C2556: with
1>C:..\juce_File.cpp(710,1): error C2556: [
1>C:..\juce_File.cpp(710,1): error C2556: _Ty=juce::FileInputStream
1>C:..\juce_File.cpp(710,1): error C2556: ] (compiling source file …..\JuceLibraryCode\include_juce_core.cpp)
1>C:..\juce_File.h(625): message : see declaration of ‘juce::File::createInputStream’ (compiling source file …..\JuceLibraryCode\include_juce_core.cpp)
1>C:..\juce_File.cpp(710,1): error C2040: ‘juce::File::createInputStream’: ‘juce::FileInputStream *(void) const’ differs in levels of indirection from ‘std::unique_ptr<juce::FileInputStream,std::default_delete<_Ty>> (void) const’
1>C:..\juce_core\files\juce_File.cpp(710,1): error C2040: with
1>C:..\juce_File.cpp(710,1): error C2040: [
1>C:..\juce_File.cpp(710,1): error C2040: _Ty=juce::FileInputStream
1>C:..\juce_File.cpp(710,1): error C2040: ] (compiling source file …..\JuceLibraryCode\include_juce_core.cpp)

I update my mac and ran the same test (creating a test audio app) and got no errors so it may only be Windows (I didn’t check Linux or Android).

Have you modified the JUCE source at all? Are you sure that your project is using the latest modules and there aren’t any conflicts with previous JUCE versions on your system?

I just deleted all the 5.4.4 files and re-downloaded them and indeed all but one of the errors went away so I must have inadvertently modified the library files during a search-and-replace for the ScopedPointer.

The error that remains is a little different:

C:..\test35\JuceLibraryCode\include_juce_gui_basics.cpp : fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj
1>cl : Command line error D8040: error creating or communicating with child process

I created a new audio project just to be sure and got the same error though only with VS2015. When I tested it with 2019 Community it built with no errors. When I added /bigobj to the “Extra Compiler Flags” section of the Visual Studio 2015 Exporter the error went away so I think I’m good to go.

ed95, Thanks for pointing me in the right direction.
Cheers,
Bob

1 Like

For the record, the change I had made was in juce_File.h where I had changed

FileInputStream* createInputStream() const;

to

std::unique_ptr<FileInputStream> createInputStream() const;

I’m still getting used to unique_ptr’s and must have been working my way back trying to route out an error and got thrown when the error was reported by VS15 as in “memory” and not a particular file though the file is clearly identified in the error message.

Yeah I updated one of my projects, which was a lot of work (lots of parameters and pointers needed to be changed). And at the end it came down to to the:
include_juce_gui_basics.cpp : fatal error C1128: number of sections exceeded object file format limit error and had to add the /bigobj as you mentioned to get to compile in vs 2015.