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
831 Views

Similar Articles

[PageSpeed] 31

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:

MSN Money Historical Charts are in Error
Can someone at Microsoft fix the Historical Charts so they are correct. Just to take one specific example, if I look at the 10-year growth chart for VCAIX (any stock will do) at http://moneycentral.msn.com/investor/partsub/funds/returns.asp?Funds=1&Symbol=US%3aVCAIX it tells me the 10 year growth of $10000 to the present time (8/08) is approximately +17%. However, if I click right under neath that graph on the link saying "view a more detailed chart", it displays the same chart that I get directly from MSN Portfolio Tracker showing a LOSS of ~20% FOR THE VERY SAME STOCK. ...

Error:An unexpected end of file parsing CDATA has occurred.
I am creating a XML document which opens fine in IE. Implies MSXML thinks it is a well formed document. But when I try to load this document in VB.net using the following code Dim doc As New XmlDocument doc.Load("C:\Projects\SQLXML\corc.xml") I get the following error: "System.Xml.XmlException: An unexpected end of file parsing CDATA has occurred. Line 6, position 1. at System.Xml.XmlScanner.ScanCData() at System.Xml.XmlScanner.ScanMarkup() at System.Xml.XmlTextReader.ParseTag() at System.Xml.XmlTextReader.ParseBeginTagExpandCharEntities() at System.Xml.XmlTextR...

Error Message: GPS Error 58, SQL Error 102, ODBC Error 37000
Posted this on Dynamics Forums too. I think I have this narrowed down to a Smartlist Error. When a user logs out of one company into another, she gets 3 errors. GPS Error: 58 (clicks ok) SQL Error: 102 ..... incorect Syntax Near ',' (clicks ok) ODBC Error: 37000 (clicks ok) Then is able to proceed to work with no problems I think it has something to do with a Smartlist Reminder or Shortcut or something like that. It only happens to her UserID. The problem is that we have over 100 users and 100 companies and everyone seems to make Smartlist favorites and set them available ...

Error 8108 #3
Source: MSADC Category: Service Controller Event ID: 8108 Description: The initialization process failed. This error is running every 5 minutes on our DC. Anyone have any ideas? I checked TechNet article Q317210 and it didn't pertain at all to our situation. We have no child domains, we're running in AD mixed mode, and all of our Exchange servers are enterprise edition, not standard as mentioned in the article. Hi Jim, Is there Exchange 5.5 or ADC running in your org? This error event may caused by ADC replication. So please temporarily step ADC and then check the issue again....

having a problem installing MSCRM 1.2!
I am having a problem installing MSCRM 1.2. My configuration consists of a Domain Controller running Win 2000 Server SP4 . I am trying to install MSCRM on a member of the domain running Windows 2000 Server SP4. There is a DNS Server on the DC which is integrated with AD, and a SQL Server 2000 running on the Win 2K machine. The install errors out when CRM creates the root business with the message: Setup was unable to install Microsoft CRM Server. Setup was unable to provision your organization. Setup was unable to create the root business. The configuration of ASP.NET seems to be ok, the pr...

Error c0070005 when trying to run Exchange System Manager
Hi Keep getting the c0070005 Exchange System Manager error message when I try to open System Manager, as a reslult I can't manage anything. Can anyone please help? Thanks Is this is? http://support.microsoft.com/default.aspx?scid=kb;en-us;Q32391 -- thogar ----------------------------------------------------------------------- thogarr's Profile: http://www.msusenet.com/member.php?userid=185 View this thread: http://www.msusenet.com/t-187051570 Thanks for the post, but I tried that and it still doesn't work Piet "thogarr" wrote: > > Is this is? > http:...

Error
I want run some SQL-script by SqlCmd.exe . In Cmd.exe I ran this command: /------------------------------------8<----------------------------------\ C:\Documents and Settings\dakr\Desktop>"C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE" -S Server1 -i "C:\Temp\Test.Sql" -o "C:\Temp\SqlCmd.rpt" \------------------------------------8<----------------------------------/ But after that there is only next error message: The syntax of the command is incorrect. If I delete the last part (-o "C:\Temp\SqlCmd.rpt") all is...

Error when migrating data from csv file to crm 3 using scribe
I have been trying to migrate data from a .csv file into MS CRM 3 using scribe. When I test the job after doing my connecting and datalinks it executes properly, however, when I run the job it only does on average 12 successful inserts and 11 failed inserts then gives me an error. The error is :"fatal error. Execution terminated - failuere fetching source rows" when I click on the error info button I get a database error " Error 1005. [22018] SQL call failed. Invalid character value" the details of the message :"source[DataDirect][ODBC Driver]" Could someone...

Error when trying to add entity in admin interface
Anyone experiencing this issue? I am able to bring up both the mobile client and the administration interface. However, when i am in the administration interface and I am trying to add an entity, and I get the following error: Server Error in '/MobileClient' Application. -------------------------------------------------------------------------------- The operation has timed out Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. E...

Microsoft Word Error
Does any body knows how to fix this? I tried Google and Microsoft KB, but can't find anything. When I try to write a document in Word, after I write a few lines, I get this message: Run Time Error Program: C/Program Files/Microsoft Office/Office 10/Windword.exe Abnormal Program Termination Then there is an X to click out. When I click it all my document is deleted The problem started about 2 weeks ago. Windows XP/SP3, IE7, AOL 9.0 Security Edition. AVG Free 9.0 Thanks, -- edith See http://word.mvps.org/FAQs/AppErrors/ProblemsStartingWord.htm for some diagnos...

Help! error Masked Edit Control In GroupBox?
In VC6.0, I created a dialog template and added two Microsoft masked edit control 6.0, they worked well. Then I added a groupbox around these two controls and resorted the controls' order, the two masked edit controls doesnot display correctly, neither in testing nor after being compiled. In the other test, I set the groupbox to invisible, the Maksed edit control works well, But I need this groupbox to be visible. I can't find any useful message in Internet. Dose anyone know why? Daniels He 20050618 >In VC6.0, I created a dialog template and added two Microsoft masked edit...

error C2065: 'IHTMLDocument3' : undeclared identifier
Hi, I get the error: C2065: 'IHTMLDocument3' : undeclared identifier at home but not at work, what am I missing on my home setup? Cheers, Rob You are missing MsHTML.h. You need to install the latest platform sdk to get this file. -- Cheers Check Abdoul [VC++ MVP] ----------------------------------- "Rob" <a@b.com> wrote in message news:u8LSg0pvDHA.3496@TK2MSFTNGP11.phx.gbl... > Hi, > > I get the error: > C2065: 'IHTMLDocument3' : undeclared identifier > > at home but not at work, what am I missing on my home setup? > > Chee...

DPM Error at Erase Tape
Hi, When i try erase a tape a get the following error in DPM server: The detailed inventory of tape failed for the following reason: (ID: 3316) The tape in Stand Alone Drive Tape Library IBM ULTRIUM-TD4 SCSI Sequential Device at Drive IBM ULTRIUM-TD4 SCSI Sequential Device has been written to by some other tape backup application by using an unsupported physical block size . DPM only supports a physical block size between 1024 bytes and 65536 bytes and hence will not be able to read or overwrite the contents of this tape. (ID: 24084). I need help for the solution Hi He...

ANN: HTTPMP 1.3.3
Hotmail accounts could be accessed with Hotmail web interface, Outlook Express or Outlook 2002. But the most common question is "How to access Hotmail in Outlook 2000?" Internet search shows there is no simple and convenient solution for this problem: Microsoft Knowledge Article 234704 "You cannot view Hotmail messages in Outlook 2000" http://support.microsoft.com/default.aspx?scid=kb;en- us;q234704. Microsoft Outlook, unlike Microsoft Outlook Express, does not have an option to use Microsoft Hotmail e-mail accounts. You can view your Hotmail e-mail in Outlook by creating...

send/receive error message: outlook data file cannot be accessed
After many problems with my pc, I had to reformat my harddrive. i reinstalled Office 2010 Beta and now I can't send or receive email. it worked for the first hour or so, but now I get the error message. I researched on these forums for solutions and found some suggestions (delete all data and .pst files, etc.) but none have fixed my problem. I have tried creating a new data file from within Outlook and deleting all outlook data and .pst files, but still it says it cant be accessed. now that I think of it, all these problems may have started after I compacted my pst file....

Great Plains upgrade
Hello, To upgrade Great Plains 5.5 on Pervasive SQL 2000 to Great Plains 7.0 do we need to first upgrade to 6.0 before we can complete the upgrade to 7.0? I tried to upgrade 5.5 on a test machine to 7.0 but all that happened was 7.0 was installed over the top of 5.5. The company database was still in pervasive but the new 7.0 great plains only had the test company database. Thanks in advance, Andy Mikkalson Contact your reseller and GP support. You will have to upgrade to 6.0 and perform a DB migration. There are tools for this that automate the process. HS "Andy Mikkalson"...

money 2002 service pack download error
i downloaded the new xp service pack, and now when i try to download something, download mangager pops up with error 1606. it wont let me download anything. please help ...

Money: Upgrading from 2003 to 2006
I wrote a long article back in February detailing my experience attempting to upgrade from 2003 to 2005. At the end of this experiment I decided to completely roll back to 2003. What I didn't take into account was that Microsoft had unknownlingly locked me into the 2006 version by hiding a ticking timebomb in my application. Knowing that my downloads were weeks away of coming to a grinding halt, I had no other option. As long as I was upgrading for good though, I decided to write my new experiences for those of you interested. ---The Decisions--- My first task was to decide which option...

vb.net forms error
When I am debugging a vb.Net 2008 windows application and click on the 'next' button, I am getting the following error: 'An unexpected error has occurred. The 'Microsoft.jet.oledb.4.0'provider is not registered on the local machine'. I think that I may need to change some setting I have in the visual studio.net 2008 professional edition to solve this problem. I am working on an workstation that is 64 bits, XP operating system. When the click event has occurred, I have just attached an excel 2003 spreadsheet to a file in the general direc...

Moving date from 1 column to another based on a value and changing the sing.
I was wondering if anyone could help me. I have seen a few examples that are fairly close to what I'm looking for. I'm wanting to look at a range of data in a column and find all the cells that have a value not equal to 0, then move it one column to the left and change the sign to negative. Below is the columns I have setup: Column A B C D E Cash 15,343.00 0 147.34 0 Petty Cash 0 150.00 300.00 0 name 0 20,000.00 20,000.00 0 w...

smtp 451 ERROR #2
In the past day or two I've been getting a postmaster with "smtp;451 Temporary local problem - please try later" in the body. This does not always happen. What is this? Thanks, Probably greylisting. http://en.wikipedia.org/wiki/Greylisting --- David L. West http://www.deskoptional.com ...

File Permission error 04-20-10
How do I get File Permission error off my word document after trying to save the document? For the error "Word cannot complete the save due to a file permission error", see: http://support.microsoft.com/kb/970950 -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "GenannP" <GenannP@discussions.microsoft.com> wrote in message news:EA9E9B9C-9A19-4BE7-A9AA-3531232F3429@microsoft.com... > How do I g...

Excel Error Message #8
Hi~ I am using Windows 98. I have a spreadsheet that contains macros - which are from a safe source. The spreadsheet has a total of 8 worksheets. The first two worksheets have data, the remaining worksheets have charts which are based off of the second worksheet. The first tab is called "Input 2" and the second is called "Total $s and Per Hr 04". The data in the "Input 2" worksheet is from Access - and the "Total $s and Per Hr 04" sheet is the same data in a more appealing format. When I try and have a cell in the Total $s tab reference ano...

Exchange error in App log.
Everything seems to be functioning okay, but received this error in the Application log after a reboot... Anyone see this before? __________________________________________________ Event Type: Error Event Source: EXOLEDB Event Category: General Event ID: 111 Date: 4/13/2004 Time: 7:02:05 AM User: N/A Computer: MESSAGING Description: Microsoft Exchange OLEDB was unable to do Schema propagation on MDB startup HRESULT = 0x80040e19. ...

Errors send email via CRM
I have just installed MS CRM for the first time. I am running win 2k and exchange 2k. I get a fairly non-descript error when I click "send" on a email activiy. When check to see if the recipient has recieved the email, it appears that they have. Checking the event log reveals the following application log entry: EventID: 2 MSCRM Platform Error Report: -------------------------------------------------------------------------------------------------------- Error: <description>mscrm key was not found in the registry</description><details>mailserverurl key was not f...