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 / Visual Studio.NET / IDE / November 2005

Tip: Looking for answers? Try searching our database.

Forcing the linker to run

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Graham Morris - 05 Nov 2005 14:09 GMT
I have a VS.NET 2003 project which makes an unmanaged C++ DLL.  There is a
custom build step which compiles an .mc (message compiler) file then runs
the resource compiler to produce a .res file which is added to the link.
The only other file in the project is a small cpp file which never changes.

If I change the mc file the custom build step correctly runs to produce a
new .res file, but the linker thinks nothing has changed and doesn't relink
the exe.  Doing a 'touch' on the cpp file in the custom build step doesn't
consistently work as the IDE seems to have decided what it is going to do
before the build starts.

It's annoying always having to do a full rebuild.  Can anyone suggest a
better way?
"TerryFei" - 07 Nov 2005 09:14 GMT
Hi,
Currently I am looking for somebody who could help you on it. We will reply
here with more                 information as soon as possible.
If you have any more concerns on it, please feel free to post here.

Best Regards!

Terry Fei[MSFT]
Microsoft Community Support
Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

"Gary Chang[MSFT]" - 08 Nov 2005 11:58 GMT
Hi Graham,

>It's annoying always having to do a full rebuild.  Can anyone
>suggest a better way?

Based on my experience, we don't have a command to invoke the linker, but
deleting the output executable will do the trick.

So I suggest you can add a command(or via a batch file) to deleting the
target output executable into the message file's custom build step, such as:

del $(TargetPath);mc -A...

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Graham Morris - 08 Nov 2005 14:57 GMT
This surprisingly doesn't work.  Or rather, it works alternately.  I modify
the custom build step to delete the exe but the linker doesn't run.  The
next time it does run because of course the exe has disappeared from the
previous time.  It's clear that VS decides what needs building BEFORE it
runs the build, so a custom build step is never going to influence the link.

I've now tried putting the mc file in a separate makefile project from the
exe.  The custom build step can now get the linker to link by deleting the
exe (as long as the exe project is dependent on the makefile project).

> Hi Graham,
>
[quoted text clipped - 24 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
"Gary Chang[MSFT]" - 09 Nov 2005 02:05 GMT
>I've now tried putting the mc file in a separate makefile project
>from the exe.  The custom build step can now get the linker to
>link by deleting the exe (as long as the exe project is dependent
>on the makefile project).

That's great, Graham!

It appears I missed this point in my test, thanks for sharing this valuable
experience with us, good luck:)

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

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.