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

Similar Articles

[PageSpeed] 44

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:

CArchive error using << operator
Hey all, I'm running into a problem with using the << or >> operators when using cout, cin, or CArchive. It keeps telling me, in the most recent case: error C2678: binary '<<' : no operator defined which takes a left-hand operand of type 'class CArchive' (or there is no acceptable conversion). The offending line of code tries to write 1 item from a vector (*allfile) to the archive (*pArchive) like so... try { (*pArchive) << (*fit); } I ran into this same error when trying to use cout or cin. Is this a compiler problem, preprocessor probl...

Multiple Bar Charts from 1 Worksheet
I have a worksheet where the columns are the years and the rows represent a percentage by school district and content area (e.g. Math, reading, etc.) I want to have 1 bar chart per row, showing each year as a separate bar. I can easily do this for 1 row at a time; however, the worksheet has 189 rows in it. In reading some of the other posts here, I think this can be done, and it uses VBA code, but I'm not sure of what that code would look like. Any help would be appreciated. Thanks Jeff On Jul 5, 12:43=A0am, Jeffrey Marks <jeffrma...@gmail.com> wrote: > I have a worksheet ...

kernel32.dll error #2
Does somebody know what to do to fix the follow error: Everytime I open Outlook 2000 and download email at the end of the download I get a kernel32.dll error and have to restart the computer to clear it otherwise it goes to dial up instead of the cable modem to send and receive emails. I am using Windows ME and have Norton Antivirus and ZoneAlarn firewall installed. Thanks in advance! ...

Default SOP Error on Sales Transaction Entry
One user gets the "Default SOP Error" on a regular basis. When the user gets this, it spreads to other users and I have a headache on my hands. I have tried creating a new user account for this user. I have uninstalled and reinstalled GP7.5Vg3. I have run checklinks on the sales side (and the entire system). Why is this happening and how on earth do I make it go away? Firing the user is NOT an option. ...

Have duplicate "Personal Folders". Afriad to delete 1-may delete b
Outlok 2003(pro) - just had to do a re-install of operating system and all programs. Windows XP Home. - I now have duplicate personal folders each with "contacts" (and everything else).. When I create a new e-mail message, and click on the To: it shows nothing in contacts -BUT- when I click on the drop down list next to the word [contacts] list, a 2nd [contacts] (looks identical) shows up and when I click on it, there is my list of all of my contacts. HELP ME PLEASE. The two [Personal Folders] listsing, one has a different icon to the left of it. One h...

Send/Receive Error messages
This message or a similar one shows up when I try to send receive messages in Outlook or Outlook Express. Task 'pop.earthlink.net - Receiving' reported error (0x8004210A) : 'The operation timed out waiting for a response from the receiving (POP) server. If you continue to receive this message, contact your server administrator or Internet service provider (ISP). The server responded: -ERR syntax error' I have contacted my ISP and I am told that it is a Microsoft issue. I have re-installed Office 2003 and Windows XP. Nothing seems to help. I'm just a little b...

Script error when tyring to create new crm contact with outlook
I have just installed CRM and web interface works ok, now I started installing outlook client and it wen't ok, only needed to install xml core separately. Everything looked great until I started testing from Outlook client, I made new crm appointment and then I tried to add new contact, I click from button labeled regarding, then from window that opened I have tried to choose account and also contact, error is same, anyway after choosing contact or account I click New... soon new window opens labeled quick create account/contact, then Internet Explorer script error box opens readin...

Insert object error
In Word 2006 when I try to insert an object from a file (another Word file, Excel file, etc.) as an icon in a Word 2007 document I receive an error "Word cnnot start the converter mswrd632.wpc." What can I do to correct this problem. Thanks. JoeP Click on the Fixit button at http://support.microsoft.com/kb/973904 -- 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 "JoeP" <JoeP@discussions.microsoft.com&g...

OWA login fails with Error: Access is Denied.
We are in the process of moving from one exchange server to another one, but having some troubles with OWA and login. On the first exchange server everything works fine with OWA, but on the second server OWA login fails after three atempts with "Error: Access is Denied." I have tried to compere settings on the two servers, but have not found differences. If I move an account from 2.server to 1.server OWA works, if I move it back OWA stops working. Reading email with Outlook works fine. We have Windows2003Server with sp1 and Exchange 2003 with Sp2 on both servers. The only difference ...

When I type in 100 a 1 appears, 10000 and 100 appear
Hi When I type in 100 I get a 1 appearing in a cell. If I type in 1 then .01 appears in a cell. The cells are formated as number with 2decimal places. If I set format to percent, I type in a 1 and 1.00% is shown. The numbers I'm typing in appear to be divided by 100. Any suggestions -- Regards Andy Use Tools|options form menu Open Edit tab and clear the Fixed Decimals box best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "AndyB" <AndyB@discussions.microsoft.com> wrote in message news:16954BEF-AE9E-4A64-A7CB-A4AD67039512@microsoft...

I keep getting an error message when I try to send an email.
Please help...recently changed from MAC Entourage to Windows Outlook. I cannot send emails but can receive with no problem. I checked with local provider and said it's not their problem as I am set up correctly with POP and SMTP servers. Here is the message I keep receiving: Task 'mail.adelphia.net - Sending' reported error (0x8004210B) : 'The operation timed out waiting for a response from the sending (SMTP) server. If you continue to receive this message, contact your server administrator or Internet service provider (ISP).' Any suggestions? Thanks! "prb...

Runtime Error When Closing Outlook
When i close Micrsoft Outlook 2000, I receive the following error: Microsoft Visual C++ Runtime Library (Path to Outlook.exe) Abnormal Program Termination. I tried to turn off the Exchang Scan in the Add-In Manager. What else can I do? I am getting the same error that Linda has described. This just started two weeks ago. I have tried reinstalling Outlook twice without success. Does anyone have a solution to this annoying problem? ...

+1 added to phone number
OL 2003: some phone numbers (in contacts) have "+1" added before the area code, some do not. this is true even for area codes that are not local. i have tried the phone number settings, but + is not allowed as a symbol. is there a way to tell outlook to add "+1" to all area codes, both for those currently entered? and for new ones? jeffrey <astro46@excite.com> wrote: > is there a way to tell outlook to add "+1" to all area codes, both > for those currently entered? and for new ones? Did you import any of these contacts? You might want to...

Refresh 1 subform from another
I am trying to refresh a subform from another subform and I cannot seem to make it work. I have a button on subform 2 that needs to have subform1 refresh. I used Me.subform1.mainform.form.refresh and I get an error that says Method or Data Member not found. Anyone know what I did wrong? I am thinking I should use ! instead of . but I don't know what the difference is between them. Any help? -- Thanks As Always Rip Ripper wrote: >I am trying to refresh a subform from another subform and I cannot seem to >make it work. I have a button on subform 2 that needs to have su...

Error 0x80042112
Hello, Since a couple of days I am receiving error 0x80042112 with a descriptive text that a message could not be downloaded from the server, with the message ID. I also get error 0x800CCC0F on a regular basis. It happens mostly with larger emails. I can see that all messages are retrieved (by the progress bar, reaching 100%), but when it's time to put them in Outlook itself, it stops and Outlook produces an error. I have tried creating a new profile, same problem. I am using Outlook 2007 and Windows Vista. The problem is really getting worse, it seems to be occurring more and mor...

Help to track down 5.7.1 errors
Users intermittently get 5.7.1 unable to relay errors, you do not have permission. I tracked this down to receiving incorrect DNS lookups, where instead of getting the MX record, Exchange is instead getting back the DNS Server's IP of the recipients external domain. What seems to fix this is if I go to a dos prompt and do a manual NSLOOKUP, then SET TYPE=MX, and then the name of the ext domain that originally failed. Sometimes it will timeout on the first try in dos. If I retry the lookup it succeeds, and then am able to send mail to the external domain no problem. Both Windows Clients...

Exchange upgrade and site consolidation GAL.
We are currently migrating to Exchange 2003 from 5.5 and consolidatin sites as well. We have successfully consolidated one of our sites int the new 2003 environment and we have all of the ADC's set up for th remainder of the sites. Replication is happening and mail is flowin fine. The problem is that the people still on 5.5 can not see the people wh have moved to 2003 in the GAL. Any one have an Idea? - CDShrev - CDShrev ----------------------------------------------------------------------- Posted via http://www.webservertalk.co -------------------------------------------------...

Full Text Indexing Error on CRM Install
Hi I'm getting the following error during install at select SQL Server "Full-Text Indexing needs to be running on the specified SQL server." I've installed Index Service, and also went back and reinstalled the full text module in SQL Server 2000. Still getting the error. How do I fix this? Hi Have you checked the indexing service is started in services? Regards Dan "amwbgi" wrote: > Hi > > I'm getting the following error during install at select SQL Server > > "Full-Text Indexing needs to be running on the specified SQL server....

Process Performance Counter Disabled Error Message when backing up
Everytime I try to backup and/or restore an act database I get this message. Any idea how to resolve it ? Even the ACT consultants have not been able to sort it out ...

upgrade from MSPOS to RMS
I an going to install RMS at a client who is using MSPOS. Is there a wizard or standard procedure to transfer the items, etc.? Maybe a simple export and import? There is probably something simple that I am missing. Hi Bill - I don't believe there's a direct upgrade from MSPOS to MSRMS; you'll need to two-step it - first export your data form MSPOS to excel (items, customers, suppliers); then use a tool like QSCimp or another third party tool to import into RMS. "Bill Cunningham" wrote: > I an going to install RMS at a client who is using MSPOS. Is there a wiza...

can u upgrade apple mac v4.2.1 to v.'X'?
can anyone help me as it is not clear from dealers or the microsoft web page - can you upgrade from v.4.2.1 on the apple mac to the current version which runs in apple mac system software 'X' which is version 10 / v.X? Many thanks In article <7176a7a3.0311030328.11e18513@posting.google.com>, info@nicolastyearchitects.co.uk (nic the greek) wrote: > can anyone help me as it is not clear from dealers or the microsoft > web page - can you upgrade from v.4.2.1 on the apple mac to the > current version which runs in apple mac system software 'X' which is > versio...

Advice for 1-Tier architecture
Can I get an advantage of the fact that my application is running on the same computer as SQL Server 2005 express? Is there faster way to connect to the data base than TCP/IP sockets? I need to operate as fast as possible. Any advice on configuration? If it is the same server you are most likely going to connect thru shared memory. But the protocol is most likely going to be your bottle neck when it comes to performance. The fact you are using express and it will be on the same computer is cause enough for concern if you are that worried about the connections. -- Andr...

MBf Packager error
Hi, I am installing Businessportal 3.0. At the data load it fails after loading 4 or 5. It always fails while loading PD_Manufacturing. Any idea why this happens? Thanks & Regards Ramesh ...

Continual Cannot Connect to Server errors
Outlook 2000 works fine for anywhere from 30 minutes to 2 hours, then suddenly stops connecting to the server. Closing and reopening Outlook solves the problem. I've done KB820672 and the problem isn't with the server - this actually happens with two different servers/mail accounts. Both accounts work perfectly in OE6.0 (which I also use and have open at the same time, although I don't have the same account on both). I have all the critical updates for Office, WinME, IE, etc. Thanks, ...

More than 1 outcome for and IF
I want to set a formula to calculate the following. I want to analyse a number. If it is less than =A325,000 insert 0 if it is between =A325,000 and =A350,000 multiply (number -=A325,000)by 55% If it is more than =A350,000 assume it is =A350,000 and multiply (50,000-=A325,000)by 55% I'm sure this is straight forward but I couldn't find a way to use IF, nor an alternative. Thanks in advance. One of many ways: =IF(A1<25000,0,MIN(A1,50000)-25000)*55% -- Kind regards, Niek Otten <Steveandshelly@gmail.com> wrote in message news:1136399508.721243.297840@g49g2000cwa.google...