Advertisement

MFC-Problems

Started by August 23, 2000 06:34 PM
1 comment, last by PGmeiner 24 years, 2 months ago
Hello Everybody, I am really helpless about the strange MFC. In my Application I include in one part Windows.h and in another part afx.h and atlbase.h. Now when I will compile the code some strange link-errors occur. Some of the following lines where spoken out: ... nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in MSVCRTD.lib(MSVCRTD.dll) nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype nafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype nafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc Debug/Filesystem.exe : fatal error LNK1120: 3 unresolved externals Error executing link.exe. ... I hope anybody here has experience with MFC and could explain me what I had to do that I can only use some classes from the MFC. thanks a lot. P.G.
Peter Gmeiner
Well... If you''re including the MFC stuff and Windows.h in the same file, that doesn''t fly.. You can''t use the WINAPI from Windows.h and MFC in the same file (unless of course you are using conditional compilation, and not including one of them some of the time.)
Advertisement
If you are using MSVC then go to Project->Options, and got to the MFC tab, and select "Use MFC in a shared library". If you use the AppWizard it will turn this on automatically, otherwise you must specify yourself.

This topic is closed to new replies.

Advertisement