Is a res file the same as a rc file? - visual-studio-2013

I was looking at a resource file properties dialog box, and I noticed it was using a .res for want it command line strings, specifically, in this section.
Resource File Name | $(IntDir)%(Filename).res
So I am confused. Is a res file the complied output from a rc file?
I'm using VS2013 Express Ed.

See this
1)Create a resource-definition script (.rc file) that describes the resources used by your application.
2)Compile the script with RC. For more information, see `http://msdn.microsoft.com/en-us/library/windows/desktop/aa381055(v=vs.85).aspx.`
3)Link the compiled resource (.res) file into the application's executable file with your linker.
i.e After compilation using rc you will get .res file.
for more Info visit http://msdn.microsoft.com/en-us/library/windows/desktop/aa380599(v=vs.85).aspx
Hope it helps you.

Related

How do I create or modify a VB6 exe Version resource block to make it Squirrel-Aware

I have this crazy idea to take a large VB6 app we are continually migrating to .NET and use the Squirrel for Windows installer. It seems I need to make the VB6 app Squirrel-Aware as described here -- add VALUE "SquirrelAwareVersion", "1" to the Version resource block.
The problem is I'm very unfamiliar with rc files and there are only bits of documentation on the format, encodings, etc especially when working with VB6. I think I need a command line tool that can add this VALUE "SquirrelAwareVersion", "1" to the Version resource of an existing exe, OR figure out how to get VB6 to use a custom .res file with all the version data in it.
Most tools only seem to modify basic resource info like icons, manifests, and strings. I would need something capable of modifying or replacing this version data.
I've attempted to create a basic .rc. I make an empty file with the name MyApp.rc. Open the file with Visual Studio. Add a "Version" resource and attempt to compile it to .res with RC.exe but I get all sorts of errors from this file generated by Visual Studio. If I close and reopen the generated RC file, even Visual Studio can't open it. Could be an encoding problem? I'm not sure how else to create a valid RC file.
You can use Resource Hacker utility in CLI mode to replace whatever resources you need to in your final executable. It can even compile .rc files to .res file with something like this:
c:> ResourceHacker.exe -open Project1.rc -save Project1.res -action compile
Then use something like this on the command line to add new or replace existing resources from a .res file into your final executable:
c:> ResourceHacker.exe -open Project1.exe -save Project1.exe -action addoverwrite -resource Project1.res
Add -log NUL parameter to suppress console output if you need to.
Make a res file in VB6. VB6 only allows editing of certain things. Use ResHacker to add anything else you want to the Res file. VB6 add it's own version so you may need to do it to the exe file. http://www.angusj.com/resourcehacker/

How to update the source location in symbol (.pdb) files

What I am trying to do is run a batch script to update .pdb files to point to a different source location. I'm not sure if there is a way to update the absolute paths in the pdb file, but currently I'm looking into inserting a source stream into the pdb file so the debugger can get the source files.
I am inserting a source stream using pdbstr.exe:
pdbstr -w -i:c:\test\pdbstream.txt -p:"C:\test\somelibrary.pdb" -s:srcrv
The pdbstream.txt contents are pretty basic:
SRCSRV: ini ------------------------------------------------
VERSION=1
SRCSRV: variables ------------------------------------------
SRCSRVTRG=%var1%
SRCSRVCMD=cmd echo %var1% >> c:\test\output.txt
SRCSRV: source files ---------------------------------------
C:\somedifferentpath\somelibrary\sources\firstclass.cs
C:\somedifferentpath\somelibrary\sources\secondclass.cs
SRCSRV: end ------------------------------------------------
According to the info on MSDN I added only the required parameters. To my understanding, this should run the command in the SRCSRVCMD variable when the debugger loads the pdb file and searches for the source files. So I would expect some output in c:\test\output.txt.
I have verified that the correct pdb file is loaded for the module, but when i'm debugging in Visual Studio it does not find any source file. The output shows:
"SRCSRV: The module 'C:\test\somelibrary.dll' does not contain source server information."
Is the source stream not valid, or am I simply overlooking a particular step? Or can I change the absolute source location in the pdb file without inserting a datastream?
Edit
To clarify, I am currently using the Visual Studio debugger. The code I am trying to debug is in private libraries I created myself. I want the .pdb files to point to the correct source files after everything (dll, pdb & source files) is moved to a different location on disk.

Front end and back end not compatible - get more linker information

while building a project in VisualStudio 2012 I get the error message
LINK : fatal error C1905: Front end and back end not compatible (must target same processor).
Checking the project manually does not help, all involved (static) libraries have been built for the same processor. I also added
/VERBOSE:lib and /VERBOSE
to command line to get some more information but this does not help, only additional output line I got by this was a stupid
Starting pass 1
So: any ideas how I can find out what causes this strange error message? How can I get more output from the linker?
Thanks!
Old question and I'm not sure whether anyone still need an answer. I had this problem with Visual Studio 2017.
Check paths for generated .obj files, especially when you use some .cpp files in more than one project (within solution) and/or use %(RelativeDir) variable in Properties -> C/C++ -> Output Files -> Object File Name. It happened to me with this path in Object File Name '$(IntDir)\%(RelativeDir)' and this $(ProjectDir)Junk\$(Platform)\ in Intermediate Directory. Error gone when I moved $(Platform) part to Object File Name.
Old paths:
Intermediate Directory: $(ProjectDir)Junk\$(Platform)\.
Object File Name: $(IntDir)\%(RelativeDir).
New paths:
Intermediate Directory: $(ProjectDir)Junk\.
Object File Name: $(IntDir)$(Platform)\%(RelativeDir).
You can also specify Object File Name option for each file, shared between multiple projects to keep using old path (or if new paths configuration isn't working for you) and get rid of that error.

borland c unable to include header file

I have a very old C project that must be opened using borlandc. my machine runs win 8 so I have installed dosbox to run borlandc
the problem is that when i build the project, there exist too many errors, all are in the form: "unable to include file "xxx.h"
kindly be noted that:
- all these header files are existing in the INCLUDE folder
- I have created the cfg file and set the correct path to that folder for the compiler, so as for the linker
- I have set the environment variables
and still have the same errors
can anyone help me with that?
Check the bcc32.cfgfile.It must be in the same directory as that of the bcc32.exe file..
Check this here.

WiX can'f find my file : unable to load file, error LGHT0103

I am using WiX 3.5 and making an installer. I have used heat.exe to bundle all the files.
It produced a WiX file. I referred in main wxs files as componentgroup ref. When I build my installer, it throws the following exception.
light.exe : error LGHT0103 : The system cannot find the file
'..........\target\tmp-release\jboss-eap-5.0\jboss-as\server\all\deploy\httpha-invoker.sar\invoker.war\WEB-INF\classes\org\jboss\invocation\http\servlet\ReadOnlyAccessFilter.class'
with type ''.
It is able load many files from this location, except the above file, even though the file is present.
Looks like you've hit the linker bug. As far as I can see, it was already reported to the WiX team, and was scheduled for v4.0. The comment to the issue states the path is more than 255 characters, so a possible workaround for you is to re-work the files/folders layout to avoid the paths of that length.
Hope this helps.
The answer of Ravz1234 works ! I used it with a environment variable e.g. env.SourcePath.
1) Set an environment variable to show on your Source Dir e.g. C:\SourceDir
2) On heat.exe add the argument -var env.SourcePath along with the other arguments
I used the variable for the directory, sys.SOURCEFILEDIR, and it worked well.

Resources