Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2005

Tip: Looking for answers? Try searching our database.

.vcproj: how to regenerate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
-DG- - 24 Oct 2005 09:41 GMT
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?
Peter Oliphant - 25 Oct 2005 23:12 GMT
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==]

>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
[quoted text clipped - 9 lines]
>
> Is there any way to force it to be recreated?
-DG- - 28 Oct 2005 11:19 GMT
>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?

Mihajlo Cvetanović - 26 Oct 2005 14:51 GMT
> 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.
-DG- - 28 Oct 2005 11:43 GMT
On Wed, 26 Oct 2005 15:51:26 +0200, Mihajlo Cvetanoviæ
<mac@RnEeMtOsVeEt.co.yu> wrote:

>> 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?

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.

>> 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?

<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.

>> This seems odd.  Shouldn't vcproj be regen'd when the project's
>> compile/link flags are changed?
[quoted text clipped - 3 lines]
>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?

>> 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.
Mihajlo Cvetanović - 31 Oct 2005 14:17 GMT
>>>In other words, there are NO refs to a given lib file within the
>>>entire project->properties menu hierarchy.  Yet the linker is looking
[quoted text clipped - 16 lines]
>         </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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.