[Fixed] Problem building release VST with new build system

Hi, here’s the condensed output of a debug64 build (works fine), and a release64 build:

1>------ Rebuild All started: Project: MIDISynthLib, Configuration: Debug x64 ------
1> MIDISynthLib.vcxproj -> C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\VisualStudio2015\x64\Debug\MIDISynthLib.lib
1> 1 file(s) copied.
2>------ Rebuild All started: Project: MIDISynth-Circuit (Shared Code), Configuration: Debug x64 ------
2> MIDISynth-Circuit (Shared Code).vcxproj -> C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\VisualStudio2015\Debug\Shared Code\MIDISynth-Circuit.lib
2> 1 file(s) copied.
3>------ Rebuild All started: Project: MIDISynth-Circuit (Standalone Plugin), Configuration: Debug x64 ------
4>------ Rebuild All started: Project: MIDISynth-Circuit (VST), Configuration: Debug x64 ------
4> Creating library C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\VisualStudio2015\Debug\VST\MIDISynth-Circuit.lib and object C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\VisualStudio2015\Debug\VST\MIDISynth-Circuit.exp
3> MIDISynth-Circuit (Standalone Plugin).vcxproj -> C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\VisualStudio2015\Debug\Standalone Plugin\MIDISynth-Circuit.exe
3> MIDISynth-Circuit (Standalone Plugin).vcxproj -> Debug\Standalone Plugin\MIDISynth-Circuit.pdb (Full PDB)
4> MIDISynth-Circuit (VST).vcxproj -> C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\VisualStudio2015\Debug\VST\MIDISynth-Circuit.dll
4> MIDISynth-Circuit (VST).vcxproj -> Debug\VST\MIDISynth-Circuit.pdb (Full PDB)
3> 1 file(s) copied.
4> 1 file(s) copied.
========== Rebuild All: 4 succeeded, 0 failed, 0 skipped ==========

1>------ Rebuild All started: Project: MIDISynthLib, Configuration: Release x64 ------
1> MIDISynthLib.vcxproj -> C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\VisualStudio2015\x64\Release\MIDISynthLib.lib
1> 1 file(s) copied.
2>------ Rebuild All started: Project: MIDISynth-Circuit (Shared Code), Configuration: Release x64 ------
2> MIDISynth-Circuit (Shared Code).vcxproj -> C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\VisualStudio2015\Release\Shared Code\MIDISynth-Circuit.lib
2> 1 file(s) copied.
3>------ Rebuild All started: Project: MIDISynth-Circuit (Standalone Plugin), Configuration: Release x64 ------
4>------ Rebuild All started: Project: MIDISynth-Circuit (VST), Configuration: Release x64 ------
4>LINK : fatal error LNK1104: cannot open file 'C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\VisualStudio2015\Release\VST\MIDISynth-Circuit.dll’
3> Generating code
3> Finished generating code
3> MIDISynth-Circuit (Standalone Plugin).vcxproj -> C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynth-Circuit\Builds\VisualStudio2015\Release\Standalone Plugin\MIDISynth-Circuit.exe
3> 1 file(s) copied.
========== Rebuild All: 3 succeeded, 1 failed, 0 skipped ==========

Same with the 32-bit builds, debug is fine, release is problematic. Can’t see anything obvious.
Also wondering whether all the output directories should have an x64 in the path for the 64-bit builds?

thx

I can’t reproduce this problem.

Do you see the same behaviour when compiling the JUCE demo plug-in?

I think you’re seeing a “bug” I’ve reported here:

I did see something similar once but couldn’t reproduce it.
The new build workflow overwrite x64/Win32.

Can you try adding intermediate paths and see if it helps?
I’ve simply add:
$(Platform)$(Configuration)

Which also makes my build scripts gather all symbols pretty simple.

thx for the suggestion, i’ll give it a go…

Please try this again with the latest Projucer

all good now, thanks

this seems to have come back, even though I haven’t done a pull since last trying this and it being ok…

Pulled the latest code from develop and again and still the same issue. Rebuilt Projucer and resaved my projects…

Do you see the same problem with the JUCE demo plug-in?

Hi Tom, no, demo plugin is fine, as are debug builds… only an issue with release…

I’m afraid I have no idea what’s going on.

I would suggest slowly making your build configuration the same as the JUCE demo plug-in. At some point it will start working.

the projucer options are the same… or are you talking options elsewhere?
I’ve compared the debug and release link options in visual studio and they’re identical, apart from where you’d expect them to be different.
the only real difference is that I’m linking in an additional external library, but I can’t see why that would affect release and not debug?
I’m also confused as to the 1104 error as to whether it’s the output that it can’t write or whether it’s input it can’t find - any ideas?

Where is the external library from? Are you linking to a debug version of the library in both cases, rather than a debug and release library respectively?

You’ll need to match the Windows runtime library settings of the static library and your plug-in, and there are four variants: Static (MT), Static debug (MTd), dynamic/DLL (MD) and dynamic/DLL debug (MDd).

It’s my own library, built as a Juce static library. All the settings match…

Just to point out that before switching to the develop branch and using the new build system this build worked fine on debug and release, with the same setup of a static library being linked into the audio plugin, so from my point of view this is a side effect of this new build system.

Is there any way to disable this or would I need to go back to the master branch and rebuild everything?

I’ve just gone and deleted the library from the disk and gone to build the debug - as expected I get a library missing error. With the release build, I get the link1104 error suggesting that this actually might be a problem opening the output file for some reason, as the error is happening before it’s pulling the additional libraries in?

I’ve done a complete clean of the build directories and done a rebuild - the output directory is populated with files as expected, but not the output .dll.

As an aside, should all the output paths for 64-bit have x64 added to them as at the moment the paths for 64-bit and 32-bit are the same…

Are you sure your Projucer options are the same as the audio plug-in demo? By default you should have an x64 directory, and I get one when I build the demo plug-in. If you’ve set your build intermediates paths or your binary location to something different then that might narrow down the problem a little.

i’ll check, but I’ve never changed those paths - it’s not something I do…

ok, so part of my issue was caused by running an old Projucer - between the change of directory to the app output directory and the bug where x64 wasn’t added to the path, my link was to an old Projucer that wasn’t getting updated when I rebuilt. Cleaned all this down and now getting the x64 as expected…

I’ve noticed that the 32-bit stuff now has Win32 in the output targets - is there any reason for this as it’s not standard VS naming…??

So, 64-bit release is good now, just need to sort the 32-bit out

I’ve just tried this on another project which I haven’t touched since moving to the develop branch and new builds and having the same issue on 32-bit release… other builds are fine

Are you seeing the same error - that the library that you’re attempting to link with cannot be opened? Have you tried deleting the Builds directory and having a new Projucer build recreate it when you save the project?