API Support Forum
OEC API > API Support > Trying to compile example
Author Topic: Trying to compile example
(1 messages, Page 1 of 1)
Moderators: VPfau
WWood7842
Posts: 9
Joined: Aug 08, 2023

It's about time...

Posted: Aug 28, 2023 @ 11:58 AM             Msg. 1 of 1
I am working with the example:

LoginDlg.cpp



when I compile using the command line:

>> g++ LoginDlg.cpp -I D:\PyLibs\windows

I get the following error messages

(note that the included directory on the command line contains stdafx.h)



CppCOMSample.h:7:3: error: #error "include 'stdafx.h' before including this file for PCH"

#error "include 'stdafx.h' before including this file for PCH"

^~~~~

In file included from LoginDlg.cpp:5:

CppCOMSample.h:18:1: error: expected class-name before '{' token

{

^

CppCOMSample.h:28:22: error: expected ';' at end of member declaration

DECLARE_MESSAGE_MAP()

^

;

In file included from LoginDlg.cpp:6:

LoginDlg.h:7:1: error: expected class-name before '{' token

{

^

LoginDlg.h:11:16: error: expected ')' before '*' token

CLoginDlg(CWnd* pParent = NULL); // standard constructor

~ ^

)

LoginDlg.h:16:2: error: 'CString' does not name a type

CString Username() const { return m_Username; }

^~~~~~~

LoginDlg.h:17:2: error: 'CString' does not name a type

CString Password() const { return m_Password; }

^~~~~~~

LoginDlg.h:18:2: error: 'CString' does not name a type

CString Server() const { return m_Server; }

^~~~~~~

LoginDlg.h:21:30: error: 'CDataExchange' has not been declared

virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support

^~~~~~~~~~~~~

LoginDlg.h:25:2: error: 'CString' does not name a type

CString m_Username;

^~~~~~~

LoginDlg.h:26:2: error: 'CString' does not name a type

CString m_Password, m_Server;

^~~~~~~

LoginDlg.cpp:11:30: error: 'CDialog' has not been declared

IMPLEMENT_DYNAMIC(CLoginDlg, CDialog)

^~~~~~~

LoginDlg.cpp:13:1: error: expected constructor, destructor, or type conversion before 'CLoginDlg'

CLoginDlg::CLoginDlg(CWnd* pParent /*=NULL*/)

^~~~~~~~~

LoginDlg.cpp:26:32: error: variable or field 'DoDataExchange' declared void

void CLoginDlg::DoDataExchange(CDataExchange* pDX)

^~~~~~~~~~~~~

LoginDlg.cpp:26:32: error: 'CDataExchange' was not declared in this scope

LoginDlg.cpp:26:47: error: 'pDX' was not declared in this scope

void CLoginDlg::DoDataExchange(CDataExchange* pDX)

^~~

LoginDlg.cpp:35:30: error: 'CDialog' has not been declared

BEGIN_MESSAGE_MAP(CLoginDlg, CDialog)

^~~~~~~

LoginDlg.cpp:36:1: error: expected constructor, destructor, or type conversion before 'END_MESSAGE_MAP'

END_MESSAGE_MAP()

^~~~~~~~~~~~~~~

Thank you
-William Wood
William Wood