.vcproj: how to regenerate

D

-DG-

I had thought that all VC compile/link options could be set from
within Visual Studio but apparently that's not the case. The .vcproj
file seems to hold refs to old files despite changes to project
config.

In other words, there are NO refs to a given lib file within the
entire project->properties menu hierarchy. Yet the linker is looking
for a missing file. It is ref'd only in the .vcproj file.

This seems odd. Shouldn't vcproj be regen'd when the project's
compile/link flags are changed?

Is there any way to force it to be recreated?
 
P

Peter Oliphant

I think you can do what you asked via the "ReBuild Solution" option ('Build'
menu) instead of using the "Build Solution" option. If you want to 'clean
up' the ".vcproj" file without having to re-compile, use the "Clean
Solution" option. These options, I believe, clean out any symbols which no
longer exist (while just "Build Solution" doesn't)! : )

[==P==]
 
?

=?ISO-8859-2?Q?Mihajlo_Cvetanovi=E6?=

-DG- said:
I had thought that all VC compile/link options could be set from
within Visual Studio but apparently that's not the case. The .vcproj
file seems to hold refs to old files despite changes to project
config.

Can you be more specific?
In other words, there are NO refs to a given lib file within the
entire project->properties menu hierarchy. Yet the linker is looking
for a missing file. It is ref'd only in the .vcproj file.

Where in the vcproj file?

Linker uses the lib file if it's in Configuration Properties > Linker >
Input > Additional Dependencies (note that it could be different for
every Configuration). It also uses the lib file if it's among the
project items (doesn't matter in which virtual folder it is). It also
uses the lib file if there is a #pragma comment(lib,"some_lib") in your
code (but that's not in the vcproj file).
This seems odd. Shouldn't vcproj be regen'd when the project's
compile/link flags are changed?

It shouldn't be "regenerated", it should be "changed" (unless vcproj is
read only, which may happen under versioning control system, or if the
project is copied from CD). If you change some irrelevant option all lib
files will still be linked.
Is there any way to force it to be recreated?

Not that I'm aware of, without some external tool. You'll have to remove
extra file references yourself.
 
D

-DG-

I think you can do what you asked via the "ReBuild Solution" option ('Build'
menu) instead of using the "Build Solution" option. If you want to 'clean
up' the ".vcproj" file without having to re-compile, use the "Clean
Solution" option. These options, I believe, clean out any symbols which no
longer exist (while just "Build Solution" doesn't)! : )

Thanks, Peter. However, nothing I've tried affects the .vcproj file.
That includes 'Clean Solution' and 'Rebuild solution.' the vcproj
file has no unusual file attributes set.

As the linker is giving a message about lib file not found, and that
file is not found anywhere within the VS project config menu, that
would imply that vcproj is disconnected, but still required within the
build. That's awkward, eh?
 
D

-DG-

Can you be more specific?

The .vcproj file refs a .lib file (link to a DLL). That .lib file is
not mentioned anywhere directly accessible within VS. In
other words, none of the compile or link options call out that
..lib file specifically.
Where in the vcproj file?
<VisualStudioProject
....

<Files>
....
<Filter
Name="Library Files"
Filter="lib"
<File

RelativePath="file_from_old_project_version.lib"
</File>
</Filter>

Aside from the file name, this is pretty much the context. The other
files (mentioned within the VS2005 config menu) are shown under
..vcproj's AdditionalDependencies="..."
Linker uses the lib file if it's in Configuration Properties > Linker >
Input > Additional Dependencies (note that it could be different for
every Configuration). It also uses the lib file if it's among the
project items (doesn't matter in which virtual folder it is). It also
uses the lib file if there is a #pragma comment(lib,"some_lib") in your
code (but that's not in the vcproj file).

Plus, evidently, if it's mentioned in the .vcproj key above. Again,
that particular lib file is not mentioned under any of the linker
options or within #pragmas.
It shouldn't be "regenerated", it should be "changed" (unless vcproj is
read only, which may happen under versioning control system, or if the
project is copied from CD). If you change some irrelevant option all lib
files will still be linked.

..vcproj has no unexpected attribs set; it's writable. You'd think
that anything necessary for linking the project would be accessible
within VS2005, but it looks like that's not the case.

Bug?
 
?

=?ISO-8859-2?Q?Mihajlo_Cvetanovi=E6?=

-DG- said:
<Files>
....
<Filter
Name="Library Files"
Filter="lib"
>
<File
RelativePath="file_from_old_project_version.lib"
>
</File>
</Filter>

In the Solution Explorer don't you have a folder named Library Files
(along with Source Files and Header Files), and in it this lib from old
project? Delete the file (in Solution Explorer) and the problem is solved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top