Copy link to clipboard
Copied
Hi everyone.
I'm trying to change a version of my plugin in the .r file, but it does not recompile the resource file - the version number stays the same.
I tried copying custom build settings from other project to the .r file, but it doesn't seem to work at all. The .rc file stays the same despite the changes in .r file. If I remove the resource file from the project it is not linked, and if I remove it from the project directory, it says that it can't find the file, and does not compile it.
Can anyone help me?
Copy link to clipboard
Copied
first i must apologize... i laughed out loud when reading your post...
i know it's wrong of me, and i'm not proud of it, but i did.
to my defense, i wasn't laughing at you, i was laughing with you.
to recompile a .rc file, you must delete the .rc file.
the build steps for the .rc compiler take effect only when that file is missing.
otherwise they just use the one that's there.
i know it sounds stupid, but here's the logic:
on windows the .r file is not used directly, and must be converted to .rc (not so on the mac).
so when you change the .r file, no change happened in the .rc. (obviously)
so when the plug-in is compiled the .rc file is used, and because it is unchanged, the compiler doesn't see a reason to recompile it...
only when that file is missing does the custom build steps for the .rc file take place.
🙂
Copy link to clipboard
Copied
Thanks, but when I deleted the .rc file, then I got an error that the rc file was not to be found, even though I copied the custom build settings to .r file. I can't seem to pinpoint what else is necessary.
EDIT: I did try to clean and rebuild the solution, to no avail. The rc file was not created during custom build process.
Copy link to clipboard
Copied
ok...
there can also be problems with the resource compiler tool when the sdk is not installed at it's default location. (c:\program files\ect...)
that problem can also happen when the specific project you're working on is not located in the same folder as the rest of the sample projects.
is that's the case, then the custom build step command needs to be adjusted to the different paths.
and in any case, what are the exact messages you're getting from the compiler?
Copy link to clipboard
Copied
1>CustomBuild:
1> Compiling the PiPL
1> Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
1> Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> BW_Vignette.r
1>ClCompile:
...
1> Generating Code...
1>RC : fatal error RC1110: could not open ..\BW_Vignette.rc
In other projects I am able to compile the rc file without any problems, it's just this one that is not working. Normally it says:
1>CustomBuild:
1> Compiling the PiPL
1> Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
1> Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> f_crop.r
1> Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
1> Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> f_crop.rrc
1>ClCompile:
So it looks like something is missing.
Thanks for all your efforts.
Copy link to clipboard
Copied
you could try brute-force solving of the problem.
duplicate a working sample project, and then just copy/paste your code into it's .cpp and .h files...
p.s.
i see you give your plug-ins a match name beginning the "BW".
so do i!!!
mine stands for "BitWise". what yours?
Copy link to clipboard
Copied
I guess that's what I'll do. Although it still bothers me. I like to know what I'm doing, not just copy/paste stuff.
BW = Bartlomiej Walczak - my name.
Copy link to clipboard
Copied
another way of trying to pinpoint the problem:
in visual studio, with the properties window open, select your project, and control + click another project that compiler correctly.
the property window will now leave all that's the same blank, and will show only what's different.
(i used that a lot to hunt down differences in settings)
Copy link to clipboard
Copied
Sorry to resurrect an old post, but did you ever find the solution to this? I have exactly the same issue with one of my projects and am struggling to fix it.
Phil
Copy link to clipboard
Copied
The solution suggested by shachar carmi will work for me. I could take my code and paste it into a copy of the Skeleton project and start over, buuuuuuut, is there a better way?
Why can't I extract the build step from an example project , and then add it to my project?
I haven't fond any good info on this yet (nothing in SDK guide, haven't finished scouring forum yet)
Can't find the build step in the example projects.
Doing it the way suggested by shachar carmi will work, but it requires many steps, and lots of copy and pasting, which means I am more likely to make a careless error, so that is why I want to know how to just extract the build step itself. (Hopefully) my proposed operation is much cleaner and more exact, requiring fewer changes.
Ashley
Copy link to clipboard
Copied
in visual studio, besides the project settings, files may have settings of
their own.
look at the "properties" of the .r file. you'll see the custom build step
there. (on a working project, of course)
Copy link to clipboard
Copied
You can also edit the .vcxproj file directly and make sure that the following text is included near the bottom. This is from the SmartyPants example, so change the .r and .rc reference names to your project name.
<ItemGroup>
<CustomBuild Include="..\SmartyPantsPiPL.r">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compiling the PiPL</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compiling the PiPL</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cl /I "$(ProjectDir)..\..\..\Headers" /EP ".."\\"%(Filename).r" > "$(IntDir)"\\"%(Filename).rr"
"$(ProjectDir)..\..\..\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc"
cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir)"\\"%(Filename)".rc
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cl /I "$(ProjectDir)..\..\..\Headers" /EP ".."\\"%(Filename).r" > "$(IntDir)"\\"%(Filename).rr"
"$(ProjectDir)..\..\..\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc"
cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir)"\\"%(Filename)".rc
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)%(Filename).rc;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)%(Filename).rc;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compiling the PiPL</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compiling the PiPL</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cl /I "$(ProjectDir)..\..\..\Headers" /EP ".."\\"%(Filename).r" > "$(IntDir)"\\"%(Filename).rr"
"$(ProjectDir)..\..\..\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc"
cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir)"\\"%(Filename)".rc
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cl /I "$(ProjectDir)..\..\..\Headers" /EP ".."\\"%(Filename).r" > "$(IntDir)"\\"%(Filename).rr"
"$(ProjectDir)..\..\..\Resources\PiPLTool" "$(IntDir)%(Filename).rr" "$(IntDir)%(Filename).rrc"
cl /D "MSWindows" /EP $(IntDir)%(Filename).rrc > "$(ProjectDir)"\\"%(Filename)".rc
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).rc;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)%(Filename).rc;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="SmartyPantsPiPL.rc" />
</ItemGroup>
Copy link to clipboard
Copied
Wow guys. I am impressed. By looking at the posting dates I had thought this forum was pretty barren, but I got two responses in less than a working day. That is impressive community dedication.
Thank you for your help, here is a screen shot for posterity, hopefully can be decent clues for future users. I am running Visual Studio 2013 Professional on Windows 10.
Checking for the
<ItemGroup>
<ResourceCompile Include="SmartyPantsPiPL.rc" />
</ItemGroup>
text in the .vcxproj file is very helpful advice too from Christian Lett. I can see in the project file exactly what is happening and that makes me happy.