English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

hi, i'm trying to learn using MFC and the first example i tried out didn't compile on visual c++ 2005. here it is:
i created a win32 empty project and added one source file with the following:

---

#include


class CMyApp : CWinApp
{
public:
virtual BOOL InitInstance();
};

class CMyWindow : CFrameWnd
{
public:
CMyWindow()
{
Create(0, L"My first app, ehi2");
}
};


BOOL CMyApp::InitInstance()
{
m_pMainWindow = new CMyWindow;

m_pMainWindow->ShowWindow(m_nCmdShow);
return TRUE;
}

CMyApp App;

-------

when i compile it says:
"Error 1 fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d] c:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h 24 "

what should i do?

2007-05-22 08:06:01 · 4 answers · asked by Amr Hassan 2 in Computers & Internet Programming & Design

i've been writing c++ for a couple of weeks now, and i thought i'd start with learning how to GUI using MFC today and it's been terrible :(
i already found that link when i googled it earlier and it didn't help, just as it didn't help the person who asked it.
and i'm using microsoft visual studio, not the experess.

2007-05-22 08:28:19 · update #1

4 answers

From a google search: http://www.thescripts.com/forum/thread465533.html

And, you're writing MFC apps as a C++ newbie? That's terrible. You should learn C++ first before trying to do anything like MFC, GUI, win32 api, etc.

2007-05-22 08:17:07 · answer #1 · answered by csanon 6 · 0 0

Check your variables, make sure none of them are undefined. Undefined reference means it's trying to pass a value that is not defined into a function. Make sure your make file compiles all items in correct order, there could be something that depends on something that was compiled before it's dependency was compiled.

2016-05-20 01:58:33 · answer #2 · answered by Anonymous · 0 0

Its been a while since I have programmed C++ but off hand you might want to check and make sure you have all the libraries that you are using linked in the properties in Visual Studio.

2007-05-22 08:15:53 · answer #3 · answered by malachi_1616 3 · 0 0

is this VC++ 2005 express, if it is AFAIK MFC is not supported on the express version

2007-05-22 08:11:55 · answer #4 · answered by Nick F 6 · 0 1

fedest.com, questions and answers