Groups | Blog | Home
all groups > visual c > april 2006 >

visual c : Altering location of .ilk file


studennett
4/30/2006 12:39:49 PM
Hi,

Is there any way to alter the location where this incremental link
information file is placed? It is always placed in the same location
as the generated .exe file, but I like to keep such 'intermediate'
files separate from my output files.

I've altered $IntDir, but this has no effect on the .ilk file.
studennett
4/30/2006 12:43:21 PM
I'm using Visual C++ 2005 Express Edition :)
Bruno van Dooren
5/1/2006 12:00:00 AM
[quoted text, click to view]

There does not seem to be a way to do so. I have created a test project,
then manually pointed the output file itself to c:\temp\application.exe.
after a rebuild, the ilk file was also in c:\temp

there is a simple workaround though: set the output folder to the same
location as the intermediate directory. then create a post-build step to
explicitly copy the output files that you want to keep to the 'real' output
dir.

--

Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"

studennett
5/1/2006 11:00:49 AM
Good thinking Bruno. It seems to work.

I'm using

xcopy "$(OutDir)\*.exe" "$(SolutionDir)bin\" /Y
del "$(OutDir)\*.exe"

Where $(OutDir) points to $(SolutionDir)ilk

(The /Y says to overwrite the destination file if it already exists.)

The only problem is that Visual C++ rebuilds the exe file every time I
tell it to build, even though I haven't made any changes.

If I don't use the 'del' command on the 2nd line, then Visual C++ can't
tell if I've deleted the exe file in the bin directory, which isn't
brilliant either.

Any further ideas?
Bruno van Dooren
5/1/2006 8:20:24 PM
[quoted text, click to view]

why would you need to delete the exe anyway?
it shouldn't be a problem that it is both in outdir and in solutiondir\bin?

anyway, if there is a file copy problem, maybe you can add a pre-build step
to delete the output files in outdir.
that way they will be gone when the post-build step is executed.

--

Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"

AddThis Social Bookmark Button