Linker Error after upgrade from VC7.1

Hello all,

After upgrading a VC7.1 project to visual studio 2005, it failed to build in
the release configuration with the follwoing error :
1>nafxcw.lib(winocc.obj) : error LNK2005: "public: class CWnd * __thiscall
CWnd::GetDlgItem(int)const " (?GetDlgItem@CWnd@@QBEPAV1@H@Z) already defined
in InstallDlg.obj

The debug build works fine.
The project uses MFC in a static library.

Well, after doing some research, it seems that this one is tied to the fact
that in a release configuration, _AFX_ENABLE_INLINES is defined, so inline
functions are embedded in the .obj file.

Sure there is a specific issue with the file "installdlg.cpp" but I failed
to find it so far. Other files in the project that are using GetDlgItem do
not fails during the link process.

TIA.


0
1/24/2007 3:48:39 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
797 Views

Similar Articles

[PageSpeed] 29

Hi,
I understand that:
You encountered the link error LNK2005 after your upgrading a VC7 project 
to VC8. The error message was:
nafxcw.lib(winocc.obj) : error LNK2005: "public: class CWnd * __thiscall
CWnd::GetDlgItem(int)const " (?GetDlgItem@CWnd@@QBEPAV1@H@Z) already defined
in InstallDlg.obj
If I have misunderstood, please let me know.

I recommend that you first check the dependencies of your project to see if 
a no-use library was included:
Project->Properties->Input->Additional Dependencies

From my research, the InstallDlg.cpp seems a file from third-party library. 
Please check if you used some third-party library in your project. 
Please also check if you use the similar structure #ifndef... 
#define....#endif in your header files, if not, please add it like this:
#ifndef MYFILE_H
#define MYFILE_H
<<declaration>>
#endif

If you have any other questions or concerns, please feel free to let me 
know.

Charles Wang
Microsoft Online Community Support

====================================================== 
When responding to posts, please "Reply to Group" via 
your newsreader so that others may learn and benefit 
from this issue. 
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights. 
======================================================


0
changliw (164)
1/25/2007 8:48:50 AM
InstallDlg.cpp is a source file comming from the project itself. It is not 
comming from a third party library.

I'm using "#pragma once" at the top of each header files, which seems to be 
the same thing ?

"Charles Wang[MSFT]" wrote:

> Hi,
> I understand that:
> You encountered the link error LNK2005 after your upgrading a VC7 project 
> to VC8. The error message was:
> nafxcw.lib(winocc.obj) : error LNK2005: "public: class CWnd * __thiscall
> CWnd::GetDlgItem(int)const " (?GetDlgItem@CWnd@@QBEPAV1@H@Z) already defined
> in InstallDlg.obj
> If I have misunderstood, please let me know.
> 
> I recommend that you first check the dependencies of your project to see if 
> a no-use library was included:
> Project->Properties->Input->Additional Dependencies
> 
> From my research, the InstallDlg.cpp seems a file from third-party library. 
> Please check if you used some third-party library in your project. 
> Please also check if you use the similar structure #ifndef... 
> #define....#endif in your header files, if not, please add it like this:
> #ifndef MYFILE_H
> #define MYFILE_H
> <<declaration>>
> #endif
> 
> If you have any other questions or concerns, please feel free to let me 
> know.
> 
> Charles Wang
> Microsoft Online Community Support
> 
> ====================================================== 
> When responding to posts, please "Reply to Group" via 
> your newsreader so that others may learn and benefit 
> from this issue. 
> ======================================================
> This posting is provided "AS IS" with no warranties, and confers no rights. 
> ======================================================
> 
> 
> 
0
1/25/2007 9:13:55 AM
Hi Oliver,
Yes, "#pragma once" has the same function as that.

For further research, I recommend that you add the /VERBOSE option to your 
linker settings.
Right click your project, click Properties, expand Configuration 
Properties, expand Linker, select Command Line, enter /VERBOSE to the 
Additional options and click OK. Then rebuild your project and post the 
verbose linking information here. 

Sincerely yours,
Charles Wang
Microsoft Online Community Support

0
changliw (164)
1/26/2007 9:27:21 AM
The result is too big to be posted here.
I've sent you a private email.

"Charles Wang[MSFT]" <changliw@online.microsoft.com> wrote in message 
news:qaGP0wSQHHA.4032@TK2MSFTNGHUB02.phx.gbl...
> Hi Oliver,
> Yes, "#pragma once" has the same function as that.
>
> For further research, I recommend that you add the /VERBOSE option to your
> linker settings.
> Right click your project, click Properties, expand Configuration
> Properties, expand Linker, select Command Line, enter /VERBOSE to the
> Additional options and click OK. Then rebuild your project and post the
> verbose linking information here.
>
> Sincerely yours,
> Charles Wang
> Microsoft Online Community Support
> 


0
1/26/2007 9:43:00 AM
I have recreated the project from scratch in VC8.
The result is the same.

"Olivier Matrot" wrote:

> The result is too big to be posted here.
> I've sent you a private email.
> 
> "Charles Wang[MSFT]" <changliw@online.microsoft.com> wrote in message 
> news:qaGP0wSQHHA.4032@TK2MSFTNGHUB02.phx.gbl...
> > Hi Oliver,
> > Yes, "#pragma once" has the same function as that.
> >
> > For further research, I recommend that you add the /VERBOSE option to your
> > linker settings.
> > Right click your project, click Properties, expand Configuration
> > Properties, expand Linker, select Command Line, enter /VERBOSE to the
> > Additional options and click OK. Then rebuild your project and post the
> > verbose linking information here.
> >
> > Sincerely yours,
> > Charles Wang
> > Microsoft Online Community Support
> > 
> 
> 
> 
0
1/26/2007 4:08:55 PM
Hi, Oliver,
Thanks for your updating and response.

I did not find some clues from the verbose log. For now, I recommend that 
you add the link option /NOD:nafxcwd.lib to ignore the library nafxcwd.lib 
to see if this issue persists. You can also try the /FORCE option to create 
a valid .exe file or DLL even if a symbol is multiply defined.

I also found some similar issues from the following links and hope they are 
helpful to you:
Linking to MFC/CRT dynamically and statically in one image
http://blogs.msdn.com/nikolad/archive/2005/01/28/362778.aspx

Title: Help with link errors - defaultlib "nafxcw.lib" conflicts
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/
Q_22105132.html

If the issue persists, is it convenient for you to mail me 
(changliw@microsoft.com) your simple project so that I can reproduce your 
issue?

Sincerely yours,
Charles Wang
Microsoft Online Community Support

====================================================== 
When responding to posts, please "Reply to Group" via 
your newsreader so that others may learn and benefit 
from this issue. 
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights. 
======================================================





0
changliw (164)
1/29/2007 12:56:17 PM
Reply:

Similar Artilces:

type double error?
I am doing some math using doubles and some trig functions ( sin cos etc) and debugging with a watch on the result. On one line the result is calculated as res = x + sin(a); and if I put a breakpoint there when it stops a is correct, x is correct but res contains "-1.#IND000000000000". I looked in the help but can't find out what causes the #IND in my double. Ron H. x-- 100 Proof News - http://www.100ProofNews.com x-- 30+ Days Binary Retention with High Completion x-- Access to over 1.9 Terabytes per Day - $8.95/Month x-- UNLIMITED DOWNLOAD Ron H wrote: > I a...

Protection error
Someone shared and protected a workbook that I created. I went to Tools>Sharing and unshared the workbook. Now when I try to make changes and save them I get an error that says "You must first unprotect the document". When I try to do this, however, the unprotect option on the Tools>Protection menu is not available. I have noticed that it says [Group] in the title bar. How do i turn that option off? If Tools|Protection|Unprotect Sheet is greyed out, you have to ungroup first. [Group] in the title bar means that you have multiple sheets selected. You can rightclick on ...

OWA 2003 Log Off Button gives HTTP 500 Internal Server Error
When Logging off of 2003 OWA I get a page cannot be displayed error message. Everything else seems to be working fine. There's a KB about this. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "Warren" <Warren@discussions.microsoft.com> wrote in message news:97769784-4AA2-4445-A0AA-86E0581681A1@microsoft.com... > When Logging off of 2003 OWA I get a page cannot be displayed error > message. > Everything else seems to be working fine. Ed, I did a search in the Knowledge Base and found nothing!!!! Help! Warren ...

Check box = 1
I'm pretty out of my depth here, so any help would be much appreciated. I'm trying to set up an attendance form to cover a 24 hour perid. i'd like a columnof 14 checkboxes (places available per hour), and at the bottom a total of how many boxes have been checked, and then repeated for the following 23 columns. How do i go about giving a cell the value of "1"if the box is checked, and accumulated the total of checked boxes. I'm struggling to get past changing "true"/"false" values to "1"/"0" values. Also, do i ...

Excel 2003 giving annoying "Send/Don't Send" error when closing
I am accessing an instance of Excel 2003 through a Codegear C++ program I'm writing. The code looks something like this (not that it really matters all that much): TExcelApplication* ea = new TExcelApplication(this); ea->Connect(); ExcelWorkbookPtr ewbPtr = ea->get_ActiveWorkbook(); // do stuff... ewbPtr.Release(); delete ea; ea = 0; I can connect to Excel and write to it just fine. However, when I try to disconnect from it and close/delete the Excel application instance, I get an annoying Excel error message that says, "Excel has encountered a problem and...

Service Call SQL Object creation error #2
Hi, I am trying to configure Service Call Management, and when I execute the step to set up permissions for the GP users who can perform service call escalations (i.e Tools \ Setup \ Project \ Service Setup \ Service button \ SQL Objects button - Set permissions for Sql Objects for Escalation, then I get the following error: 'An error occurred executing add group statements'. When I click OK the next error is: 'The role FSSQLJOB does not exist in the current database.' I am on GP10 and am doing this in the Fabrikam database. Thanks Neil You will want to run the follow...

Exchange 2007 Error Updating Free/Busy Information
Here's the Message we're receiving in our event log. The Messaging environment was moved from Exchange 2000 to 2007. "Error updating public folder with free/busy information on virtual machine EXCHSVR. The error number is 0x80040115" This error looks like it started after the DST Time change. Any ideas? ...

Publisher Error
I am running Windows ME and re-installed MS Office Premium 2000. Word runs okay, so does Excel, and PowerPoint, but I tried to Open and run Publisher and I get the following Publisher Error Message: Publisher cannot load the required file (ptxt9.dll). You may be out of memory, or the file may be corrupt. Please someone help me. I even went and disabled some start-up programs to free-up some system resources so I have enough to start programs such as Publisher and Corel Draw. I ran Publisher before I did the re-install and I never had any problems. Thanks Leo PUB2000 Error Message: Publish...

Outlook 2003 - Line 227
A customer of mine is attempting to printer HTML based email and receives the following error: ---- Error A Runtime Error has occurred. Do you wish to Debug? Line: 227 Error: The specified module could not be found. ---- I have uninstalled and re-installed (with all options) Office 2003. Attempted to print a Text based email, and it printed without any issue. Attempted to print and HTML based email, and I would get this error. Downloaded and updated all available MS Office updates. Same results. Removed all of the HP software for the printer. Downloaded and installed the latest version of...

Make $1,000.00 a day !
Found a quick way to make lots of money effortlessly. I made $180 in just 4 days after joining this affiliate program. It comes a 100% 90day moneyback guarantee. Join risk free. Give it a try, you'll love it. <http://hop.clickbank.net/?reneng/mmitums> --- MAF Anti-Spam ID: 20050420235059T4s5XoH1 ...

UPGRADING COMPUTER
I recently upgraded from OS-ME w/outlook 2000 to XP- professional w/outlook 2000 and when I synchronized for the first time, I lost the colors i programmed under the "organize" section of my ibox. I should mention that i have a exchange server. I'm sure that on my old computer there is a file that contains the "colors" that I can import into my new computer. Please advise. Thanks Mike ...

ListBox Showing Scroll if 1 item
I have a ListBox that I fill with data from my database. I then set the number of rows attribute to the count so the box is only as large as the number of fields. lbDisplay.Rows = lbDisplay.Items.Count; This works fine. The problem is if the list has 1 item, it shows a dropdown arrow and when you press it, it shows only the one item. If there are 2 or more there is no dropdown arrow. How can I get rid of the dropdown arrow for one entry??? Why does it even show? Thanks, Tom you can't, because it sets the of the number of visible options. 1 = dropdown...

Migration From 1.2 to 3.0
Dear all, We want to do a new installation of CRM3.0 on a new server. How to migrate data from 1.2 to 3.0 ? (1)Somebody suggested to use data migration tools. I don't like it because I have experienced before (when I migrate Goldmine to CRM 1.2). It is very headache and time-consuming. (2)Somebody suggested to do a new installation for CRM1.2 and upgrade to CRM3.0. Does it mean I can copy the database of 1.2 to a new server and install CRM1.2 ? I would actually first upgrade your existing system. Then look to migrating to the new hardware. With v3, the DB is a lot easier to mov...

RDLC 2008 Error in print layout mode
Hi I have converted a local report in a windows form application from VisualStudio 2008 to VisualStudio 2010. In the report viewer the report is correctly visualized, but, sometimes, in print layout (or if i print the report) I obtain this exception: "An error has occurred during report processing" "Index was outside the bounds of the array". The report is binding to a object data source, if i delete some object from my data source the error disappear. Thank in advance Giorgio Hi Giorgio, Is your object in your data source shared by multiple thread...

Coverting from 3 letters to 1
I currently have a program that can convert codes from 1 letter to 3 an a number that is involved with the letters. This is the macro. MODULE Option Explicit Function myConversion(rng As Range) As String Dim res As Variant Dim LookUpTable As Range Dim iCtr As Long Dim myStr As String Set rng = rng(1) Set LookUpTable = Worksheets("sheet2").Range("a:b") myStr = "" For iCtr = 1 To Len(rng.Value) res = Application.VLookup(Mid(rng.Value, iCtr, 1), _ LookUpTable, 2, False) If IsError(res) Then myStr = myStr & "-?" Else myStr = myStr & "-&qu...

upgrade to 2.0.0114 from 1.31010
Hi group, I plan to peform this upgrade in 10 days from now... just before the Holidays shopping season! HQ with 7 stores Any general words of advice, suggestions of steps to be taken that is not found in the published MS documentation. Thanks Frederic Hurlet Did it for 5 stores a few weeks ago and it is all pretty straightforward Only thing I will say to make sure is that if you have purchased any add-ons for RMS make sure you find out if you need to upgrade those too, most of them have to be "Frederic Hurlet" wrote: > Hi group, > > I plan to peform this upgrade...

Error Messages #4
I just bought a computer that has Windows XP and I installed my Office XP programs. At least 20 to 30 times a day when I am using Outlook 2002, I get an error message that asks me to send the info to Microsoft and then I lose the e-mail address or address that I had typed in the new message I was about to send Does any one know what is happening? How about telling us what the message is that you got? Error messages are there for a reason, not just for annoyance and we arent the Amazing Kreskin. :-) First, you should read the error message and attend to that. Taen that should solve your pro...

Error while synchronizing outlook
Hi there, I have created a new account/contact/opportunity in offline mode. When I go to online (clicking the "go Online" buttong in outlook toolbar), I am getting "The specified domain logon name already exists. You must use a unique domain logon name or open the user record that is using this name already" error. We are about to make a decision on buying the MS CRM solution, and the main factor for choosing MS CRM is the Offline capability. How to fix this error, so that I can show a working demo to my VP?. Any help is greatly appreciated. Thanks Ed ...

StartDoc() returns -1
Below is a section of code that I am using, it always works the first time but on the second call StartDoc always returns -1. I can't even find out the particular error. What is going wrong? //////////////////////////////////////////////// dcp.Attach(theApp.printerDC()); DOCINFO doc; // Doc info. // memset(&doc, 0, sizeof(doc)); doc.cbSize = sizeof (doc); doc.lpszDocName = "Doc"; doc.fwType=0; doc.lpszDatatype=0; doc.lpszOutput=0; int q=dcp.StartDoc(&doc); if (q<0) { return; } "Chris Baker" <ChrisBaker@discussions.microsoft.com> wrote in messag...

Error message in Outlook #9
I have just got a blackberry and am trying to set up outlook to use with it. I have had my computer 5 years, but never tried to use outlook before. When I click on it, I get the following error message: "The extension configuration file c:\Program Files\microsoft office\office\addins\fldpub.ecf could not be installed. There is an error in the syntex or format of the file" This is then followed by "Unable to alter your defualt email folders. Create a new profile, make it your default by selecting it, and then clicking Always use this Profile". When I try to open th...

Microsoft Money 2001 Runtime error
I am getting the following runtime error when I try to start Microsoft Money 2001 Deluxe using Windows XP. Any suggestions on how to fix this? Product support no longer supports this version. Money: Runtime Error! Program C:\PROGRAM FILES\MICROSOFT MONEY\SYSTEM\MSMONEY.EXE This application required the Runtime to terminate it in an unusual way Try the steps in the following article: http://support.microsoft.com/default.aspx?scid=kb;en-us;305254&Product=mny "Tracie" <traciemjordan@hotmail.com> wrote in message news:a84201c435fd$2f7b6330$a501280a@phx.gbl... > I a...

Exchange 200 to 2003 upgrade
We are planning an upgrade of our Exchange 2000 systems to Exchange 2003. The current Exchage 2000 systems are 2 node clusters Active/Passive and the upgrade will be done by evicting an Exchange 2000 node and then rejoining a Windows 2003/ Exchange 2003 server to the cluster with shared storage. Has anyone done this and what is their experience in regards to how long the Exchange DB upgrade may take (in general/ your experience in relation to size of DB)? Also as to what the best PerfMon counters are to watch during the upgrade process. Any and all help is appreciated Mike You might be b...

Error when posting a Sales Batch
Hello, I'm using GP 8.0 with SQL 2000 SP3 on a Windows 2000 Server SP4 I'm getting an error when posting a Sales Batch. The error message I'm getting is "The payment number is not reserved in Receivables Management". The Batch has two Sales Orders that has deposits on the Orders. The Sales Orders is then transfer to Invoices and the Invoice is what get post in the Sales Batch. I have follow the KB 862199 and it will correct the problem and I'm able to post batches but then for some odd reason I will get this error again a couple of days later with a different ...

Compile error!
Have just reinstalled Office 2000 and when trying to load Excel I get the following error message - "Compile error in hidden module: TBRun97". My new OS is XP Pro which I just installed over Win 98. After the install I had to reinstall Office and have since had the problem. XL: Compile Error in Hidden Module Tbrun97.xls http://support.microsoft.com/default.aspx?scid=kb;en-us;272066 TextBridge (scanner OCR software) addin has a problem. Move it out of your XLStart folder. Tony wrote: > > Have just reinstalled Office 2000 and when trying to load Excel I get the > foll...

exchange version 6.5 build 7226.6: service pack 1 delivers blank m
hi, we use exchange 2003 sp1(version 6.5 build 7226.6: service pack 1) and we have the following problem: - when some of our PDA users sends an e-mail - some of the exchange recipients that receive the e-mail as part of a group - can see no body for the e-mail - it is just blank; on the client side users user outlook 2003. Those are the headers of the two e-mails: Header of the e-mail taken from recipients mailbox - there is no e-mail body - empty/blank: ==================== Microsoft Mail Internet Headers Version 2.0 MIME-Version: 1.0 Content-Type: application/ms-tnef; name="win...