How to force the compiler to always re-compile a given source file?

Hi,

I realise that this is not a MFC related question but this groups is the one 
that I most often read (and like) so here it is...

Is there a way to force VS2005 compiler to always re-compile a given C++ 
file regardless of if it has changed or not since the last compile?  That 
is, I'd like the file to be compiled everytime I run the build/rebuild.  I 
could, I guess, delete the associated obj file after each build (e.g. using 
post build event) but this would trigger build every time I try to run/debug 
the app from within IDE.
I know that I'm trying to break basic rules of nmake/make but still, is 
there a clever way of doing it?

Thanks,
Bogdan


0
8/14/2007 2:24:25 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
733 Views

Similar Articles

[PageSpeed] 5

"Bogdan" <nouser@nodomain.com> wrote in message 
news:uotzn7n3HHA.600@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> I realise that this is not a MFC related question but this groups is the 
> one that I most often read (and like) so here it is...
>
> Is there a way to force VS2005 compiler to always re-compile a given C++ 
> file regardless of if it has changed or not since the last compile?  That 
> is, I'd like the file to be compiled everytime I run the build/rebuild.  I 
> could, I guess, delete the associated obj file after each build (e.g. 
> using post build event) but this would trigger build every time I try to 
> run/debug the app from within IDE.
> I know that I'm trying to break basic rules of nmake/make but still, is 
> there a clever way of doing it?
>
> Thanks,
> Bogdan
>
>

Would it work if you did the delete in the PRE-build step?

Les 


0
8/14/2007 3:50:57 PM
"Les" <l.neilson@nospam.acecad.co.uk> wrote in message 
news:f9sir3$bh7$1@newsreader.cw.net...
>
> "Bogdan" <nouser@nodomain.com> wrote in message 
> news:uotzn7n3HHA.600@TK2MSFTNGP05.phx.gbl...
>> Hi,
>>
>> I realise that this is not a MFC related question but this groups is the 
>> one that I most often read (and like) so here it is...
>>
>> Is there a way to force VS2005 compiler to always re-compile a given C++ 
>> file regardless of if it has changed or not since the last compile?  That 
>> is, I'd like the file to be compiled everytime I run the build/rebuild. 
>> I could, I guess, delete the associated obj file after each build (e.g. 
>> using post build event) but this would trigger build every time I try to 
>> run/debug the app from within IDE.
>> I know that I'm trying to break basic rules of nmake/make but still, is 
>> there a clever way of doing it?
>>
>> Thanks,
>> Bogdan
>>
>>
>
> Would it work if you did the delete in the PRE-build step?
>
> Les
>

Yes, it would.  Embarrassingly simple.
thanks 


0
8/14/2007 5:58:07 PM
Hi,

I am not terribly sure, but maybe unset "Using Precompiled header" in =
the files properties?
Right click on the file, choose properties.

HTH,
"Les" <l.neilson@nospam.acecad.co.uk> wrote in message =
news:f9sir3$bh7$1@newsreader.cw.net...
>=20
> "Bogdan" <nouser@nodomain.com> wrote in message=20
> news:uotzn7n3HHA.600@TK2MSFTNGP05.phx.gbl...
>> Hi,
>>
>> I realise that this is not a MFC related question but this groups is =
the=20
>> one that I most often read (and like) so here it is...
>>
>> Is there a way to force VS2005 compiler to always re-compile a given =
C++=20
>> file regardless of if it has changed or not since the last compile?  =
That=20
>> is, I'd like the file to be compiled everytime I run the =
build/rebuild.  I=20
>> could, I guess, delete the associated obj file after each build (e.g. =

>> using post build event) but this would trigger build every time I try =
to=20
>> run/debug the app from within IDE.
>> I know that I'm trying to break basic rules of nmake/make but still, =
is=20
>> there a clever way of doing it?
>>
>> Thanks,
>> Bogdan
>>
>>
>=20
> Would it work if you did the delete in the PRE-build step?
>=20
> Les=20
>=20
>
0
Nobody530 (222)
8/14/2007 9:31:49 PM
No, this would merely slow down the compilation when it happened, but it would not force a
compilation.  The earlier answer of the pre-build step seems to be the correct solution.
				joe

On Tue, 14 Aug 2007 14:31:49 -0700, "Nobody" <Nobody@yahoo.com> wrote:

>Hi,
>
>I am not terribly sure, but maybe unset "Using Precompiled header" in the files properties?
>Right click on the file, choose properties.
>
>HTH,
>"Les" <l.neilson@nospam.acecad.co.uk> wrote in message news:f9sir3$bh7$1@newsreader.cw.net...
>> 
>> "Bogdan" <nouser@nodomain.com> wrote in message 
>> news:uotzn7n3HHA.600@TK2MSFTNGP05.phx.gbl...
>>> Hi,
>>>
>>> I realise that this is not a MFC related question but this groups is the 
>>> one that I most often read (and like) so here it is...
>>>
>>> Is there a way to force VS2005 compiler to always re-compile a given C++ 
>>> file regardless of if it has changed or not since the last compile?  That 
>>> is, I'd like the file to be compiled everytime I run the build/rebuild.  I 
>>> could, I guess, delete the associated obj file after each build (e.g. 
>>> using post build event) but this would trigger build every time I try to 
>>> run/debug the app from within IDE.
>>> I know that I'm trying to break basic rules of nmake/make but still, is 
>>> there a clever way of doing it?
>>>
>>> Thanks,
>>> Bogdan
>>>
>>>
>> 
>> Would it work if you did the delete in the PRE-build step?
>> 
>> Les 
>> 
>>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
8/20/2007 5:16:21 AM
Reply:

Similar Artilces:

Re: Copy is criteria met
Meant for another question -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "Don Guillett" <dguillett1@gmail.com> wrote in message news:... > Sub GETDATA() > > With Sheet2.Range("a1:a200") > Set c = .Find(What:="FILE ID #", LookIn:=xlValues, LookAt:=xlPart, _ > SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True) > r = 2 > If Not c Is Nothing Then > firstAddress = c.Address > Do > 'MsgBox c.Row > With Sheet3 > ...

Closing an Excel file generates a .txt file
This seems to happen with only a few (10) files that have Macros. When you close out of a locally stored excel file (not saving it) a .txt file is generated. I have duplicated this on Excel 97 and 2002. All the .txt file contains is "updating menu". Does anyone know why this is happening? Thanks, It sounds like there's a macro at work. If you open one of those files with macros disabled. You can set your security level to high in xl2002 by: Tools|Macro|security|Security level tab. then open the workbook. Then close it. Does it still get created? If no, then it sounds...

File::Open shows no error but file is not written
Hello After calling the following method: file.Open(sName, CFile::modeWrite | CFile::modeCreate, &ex); I see no error whatsoever (I event trace GetLastError and always get 'No errror occured.') but the file is not created and not written at all. It only happens if I earlier load some XML file using external library (the lib loads file using raw FILE handle and fopen, fclose functions). Is there some known problem with mixing FILE, CFile to load/save data which cause this behaviour ? thanks si si wrote: > Hello > > After calling the following method: > > fi...

Outlook 2000 Help Files
I am getting an error message when I try to open Outlook Help 0xc0000005-0x5d49328d Tech suppport doesn't recognise the 0x5d49328d part of the code Two other related facts Outlook slows my machine, almost, to a standstill when collecting mail from Exchange. PCdoc says I have missing help files Finally I have tried repairing Outlook according to Ms Kb article 260200 Any Ideas ? Thanks ...

English version of WMP11 always starts in Japanese!
Hello, I use a Sony Vaio with Japanese OS [XP SP3], since I live in Japan, but I prefer to use WMP11 in English. But after downloading the English version, it automatically starts in Japanese. The version is 11.0.5721.5268. Perhaps I can change some setting on my pc in order to get WMP to start in English? Any help greatly apprectiated! ...

Force Uninstall
All, A coupla questions . . . Suppose I just want to forcefully uninstall Exchange 2000 from a server, and an org. Currently the uninstall fails because (as mentioned in a previous post) I have users that still show as being on that server, however the store that those users were on is no longer there (because of a disaster). Is there some way to force the uninstall? Another question. I have two healthy clustered machines running currently. Suppose I just remove the object for the old exchange server from the ESM? Assuming I have performed all of the other steps steps (like moving o...

forcing user input into cells
howdy all... i'm new to doing stuff with excel have a bit of a background in javascript programming what i'm trying to do is force a user to enter something, anything int a specific cell if the user tries to tab past the cell and leave it blank, i want a error to come up, telling them that they have to enter something befor they can continue on with entry into other cells any help would be much appreciated -Thank -- georgi ----------------------------------------------------------------------- georgio's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=164...

Importing a CSV file
I want to import a file into physical inventory. Here is what I do: 1) Run a Quantity report(I don't think the report really matters) 2) I put it in alphabetical order, then I export it using RMS Manager into a ..CSV file 3) I go into Inventory > Physical Inventory, and I click on New and Manuel Entry 4) I import the file...it works just fine!!! BUT If you in any way alter the .CSV file, and save it again, in the same format Steps 1 - 4 won't work...WHY WHAT THE HECK AM I DOING WRONG??? -- Thank You Vince :) The problem might be the Item Lookup Codes are being modified by ...

opening multiple files #4
Excel will not open multiple files. You need to describe the scenario as Excel ordinarily will open multiple files. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ ...

How do I unrestrict access to files Information Rights Mgmnt?
Yesterday I was working on an excel spreadsheet and could not do "print preview" without being questioned about Information rights Management in MS Office 2003. I could not get past this so I went ahead and set up a couple email addresses of people who could access this file. Now the software will not properly authorize my opening this file as it cannot verify my email address. I do not know how to unrestrict the file so that I can continue working on it. ...

Re: Ranking my results in a query to get the TOP#10 percent
Hello, I have created several queries and now I would like to rank my result to only get the TOP 10 percent. Could you please assist me with an Access SQL statement that can accomplish this? Thanks, TL SELECT TOP 10 PERCENT * FROM somewhere ORDER BY someExpression It is not a 'rank' in itself, though, just a pick of the 'top most'. Light difference between the two expressions, but it probably does not matter... :-) Vanderghast, Access MVP "TL" <TL@discussions.microsoft.com> wrote in message news:E6549C8D-9FDC-4568-B73F-434BAF601BD7@mi...

Force quit
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Closing Word get error message &quot;A file error has occurred. Check your network connections or make sure the disk is properly inserted&quot; Am then required to use force quit. Anybody have solution? Make sure Office & OS X are fully updated. If they are & you still encounter the problem, crashing on Quit is usually the result of one of theses causes: Need to repair disk permissions Damaged preference files Corrupt Normal.dotm template See this page for the respective links in t...

Corrupted PST file
situation as follows; 1. from notebook, copied PST file to CD (using Nero) 2. open PST at home PC, using open PST file...; error msg "not valid PST file" 3. use scanpst.exe utility ... same msg "not valid PST valid" 4. tried import command in Outlook... same msg "not valid PST valid" what gives? TMT You either burned the data too fast (PST files don't like to be burned above 4x) and/or you didn't check the option to remove the ";1" from the file names in Nero's options dialog. -- Due to the Swen virus, all e-mails sent to this account w...

Re: Print records from database
sorry, forgot to add my version of Publisher: 2003 Fritz "Fritz Anton" <fritz.anton@aon.at> schrieb im Newsbeitrag news:... > Hi, > I am trying to set up a catalogue merge form in Publisher and I have > successfully formatted merge fields and established the data link to an > Access database. > Now comes the problem: I want to print DVD labels on a standard 2 labels per > page Avery form. I addition, I want to print each record twice per label > (rotated 180 deg). I can only set one record field area per page which I > fill with four text fields in the...

Help with HttpFileCollection and keeping files in memory
Hi All, I was wondering if I could get an example of taking files from HttpFileCollection and keeping them in memory to perform an operation on them. Specifically, I am working with Images. Ideally, I would like to be loading each file uploaded in to a Bitmap, performing an operation on the Bitmap, then saving it. I have also read that anything uploaded more than 256k is buffered to disk. I would like to know how to get around this issue. Basically, the website is an image processing site, and I need it to work as fast as possible, hence I am trying to do everything in memo...

Importing messages and files to Favorite Folders
have my POP email accounts set up in WLM. I imported all my message folders .They went in to Imported Folder. My question is how can I move the folders into my Pop email account Folder. I have a pop server account named: 1st Account BOB Inbox Drafts Sent Items Junk email Deleted 2nd Account JOHN Drafts Sent Items Junk Items Deleted Items Imported Folders Drafts Sent Deleted Imported Folder (1) Under Folder (1) are all my imported Folders with my email messages in them. How can I get these Folders into Bob's account Thanks in Advance Doug ...

Conditional compiling
I'm writing C++ code that I'd like to compile with both VC++ and g++. I can get by very well with preprocessor conditionals, but I don't know what to test for. Is there a preprocessor macro I can test for to see if the compiler is Visual C++ (and #ifndef, include the g++ code instead)? Thanks! Pete On 10 Apr 2006 19:14:07 +0200, Peter Jay Salzman <p@dirac.org> wrote: >I'm writing C++ code that I'd like to compile with both VC++ and g++. I can >get by very well with preprocessor conditionals, but I don't know what to >test for. > >Is there a pr...

Printing File Detail Lists From Explorer
Hey, I'm trying to print a list of file names from explorer but there doesn't seem to be anyway to do it :-(. I know its possible because i've done it before somehow but i can't remember how. Ideally I'd also like to batch print all the contents of the file too, there are about 300 files so opening and printing each one would take a while. Hope you can help Adam :-) ...

relative file path location
Hi all, I am using Excel XP on a network at my work place, my problem is that if I have two excel workbooks, one of which links to the other. Now if I have the both files open the link "file path" is straight forward, however if one files is shut the link obviously contains the full file path location. open = file name / cell closed = file path / file name / cell My problem is that I would like to email both of the files but I understand that if this is outside of my company the file location link will no longer work, is there a way to create a "relative file path lo...

how to compile ".hh" file?
Hi, I am having ".... No compile tool is associated with the file extention" message when I try to compile a .hh file. (I am using VC 6.0 ) What should i do. Thanks.. Kerim -- On Mon, 12 Jul 2004 10:22:48 +0300, Kerim ISIK wrote: > Hi, > I am having ".... No compile tool is associated with the file extention" > message when I try to compile a .hh file. (I am using VC 6.0 ) What should i > do. If I remember correctly is this a 'standard' that is used on Unix. I.e. to separate C++ from C they use ..cc ..hh for C++ and ..c ..h for C In our little W...

picture doesn't appear when file opened.
The picture (tif or jpeg created in Digital Imaging Pro 10) will appear if I open picture file by going thru documents; but picture will not appear if I go thru Publisher "open". I used "repair" and "reinstall" but it doesn't help. -- Mae Mae McGerm wrote: > The picture (tif or jpeg created in Digital Imaging Pro 10) will appear if I > open picture file by going thru documents; but picture will not appear if I > go thru Publisher "open". I used "repair" and "reinstall" but it doesn't > help. Are you ...

Forcing Appointments
I use outlook to schedule appointments with my customers with specific employees. I have a scheduling department that does this scheduling via outlook. The employees have no option to reject or modify these appointments; therefore, I would like to force this on their calendar with them having to accept it and not allowing them to modify it. Additionally, I need to know real time once they are scheduled. Right now I don't know they are scheduled until they accept and that sometimes takes too long and then they are inadvertently double booked by the scheduling department. So how do ...

Export .zip files from emails
Does anyone know of a way to have an email with say a .zip attachment within it have the attachment automatically saved out of the email and to a folder on the server? A user could really do with this sort of functionality as they get around 100 emails from a specific source with these type of attachments a day. Thanks in advance. Mike ...

How do I export Lotus Approach files into an Excel spreadsheet?
I need to export data from Lotus Approach to Excel; please help. I am using an old version of Lotus SmartSuite 9.5 and I have Microsoft Office 2003 Basic. Well, I don't know Approach at all but is there a common file format that both use e.g. comma delimited. If so , save in that format from Approach and import into Excel. "LEWOLF" wrote: > I need to export data from Lotus Approach to Excel; please help. I am using > an old version of Lotus SmartSuite 9.5 and I have Microsoft Office 2003 Basic. ...

Publisher cannot open the file you specified
Hi On a new installation of Pub 2003 on XP, when trying to open a saved file comes up with ' Publisher cannot find the file you specified. The next dialog box will let you browse to locate the file on your hard disk or floppy disk' This seems like a systemic thing, but have run Norton Windoctor, reinstalled, but no luck, continues to get this message, or 'unable to open file'. Any suggestions please This is usually a Norton problem, disable "scrip blocking" and maybe in Norton options, disable "Office Plug-ins." You receive a "File is not avail...