Windows retargetting does not seem to work?


#1

Newbie question. I open p a demo project in Projucer. I set the windows target to 10.0.17134.0 (what I have on my machine) & save project I fire up VStudio - compile fails because code references to 10.0.16284.0. I do retarget solution in VStudio and target to 10.0.17134.0 - compile still fails. I seem to need to manually replace all occurrences of 16284 to 17134 in the vcxproj file. After that compile succeeds fine.

Is this normal or am I missing something?


#2

I just had the same problem! :slight_smile: Going back into Projucer, on the Exporter for Visual Studio (2017, in my case), I had to manually put in 10.0.17134.0 in the Windows Target Platform field. (Scroll down to see that.)


#3

Yeah, I did that too (i.e. put the 17134 in the windows target platform in Projucer) - but even if I do that and re-save the project, it still doesn’t compile. Unless I edit the vcxproj file … weird … Doesn’t stop me from getting things compiled but still weird.


#4

Did you regenerate the sources from Projucer after making the change. As a general practice to be certain I always get the new stuff, I often delete the Builds folder after making changes in Projucer, select “Save All” (just in case), and then export again. I did that in this case and it compiled perfectly afterwards.


#5

Ah!!! No I didn’t. But I did resave the project, and the vcxproj file still had the wrong references. I’ll try and delete that one too before resaving the project…


#6

OK. I tried setting the target in Projucer, delete the vcxproj file, resave the project and then it works. Still weird, is this a bug or expected behavior?


#7

I think it is probably a bug. I just experienced the same thing.

I opened the .vcxproj in Visual Studio Code (my favorite tool for lots of things but especially editing VS project files, even while VS itself is open), and search-and-replaced “16299” with “17134” – there are various occurrences of the SDK number that VS evidently doesn’t update. (I don’t have Projucer yet, I’m trying to use the juce_core and audio libraries only while using Unity for my entire GUI.)

After doing that, the error no longer appears. So it seems like this might be a VS issue with retargeting the particular sort of projects that Projucer generates. Pretty easy workaround, at least.