I want this structure variable as well as all the structure elements to be used in multiple source(.cpp) files. I did like this and getting did like this and getting following errors. I am using vs2010. Please help me i am a newbie.
Error
2
error LNK2001: unresolved external symbol "struct setthresholdfinedflb set_thresholdfinedflb" (?set_thresholdfinedflb@@3Usetthresholdfinedflb@@A)
C:\Users\jeevan\Desktop\socket_struct\socket\socket\FineDfThresholdLB.obj
Error 3 error LNK2019: unresolved external symbol "struct setthresholdfinedflb set_thresholdfinedflb" (?set_thresholdfinedflb@@3Usetthresholdfinedflb@@A) referenced in function "public: __thiscall CsocketDlg::CsocketDlg(class CWnd *)" (??0CsocketDlg@@QAE@PAVCWnd@@@Z)
C:\Users\jeevan\Desktop\socket_struct\socket\socket\socketDlg.obj
Error 4 error LNK2019: unresolved external symbol "public: void __thiscall CsocketDlg::OnReceive(void)" (?OnReceive@CsocketDlg@@QAEXXZ) referenced in function "protected: virtual void __thiscall mysocket2::OnReceive(int)" (?OnReceive@mysocket2@@MAEXH@Z)
C:\Users\jeevan\Desktop\socket_struct\socket\socket\mysocket2.obj
Error 5 error LNK1120: 2 unresolved externals
C:\Users\jeevan\Desktop\socket_struct\socket\Debug\socket.exe
// socketDlg.h : header file
//
#pragma once
#include "mysocket1.h"
#include "mysocket2.h"
#include "FineDfThresholdLB.h"
struct setthresholdfinedflb{
unsigned char sof_lb;
//unsigned char msg_type;
unsigned short command_code;
unsigned short sequence_no;
unsigned int msg_length;
unsigned char eof_lb;
unsigned char threshold_value;
};
extern setthresholdfinedflb set_thresholdfinedflb;
// CsocketDlg dialog
class CsocketDlg : public CDialogEx
{
// Construction
public:
CsocketDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
enum { IDD = IDD_SOCKET_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
CButton m_ctlConnect;
CString m_strMessage;
CString m_strName;
int m_iPort;
CListBox m_ctlRecvd;
CListBox m_ctlSent;
int m_iType;
afx_msg void OnRType();
afx_msg void OnServer();
public:
afx_msg void OnClickedBconnect();
void OnAccept(void);
void OnConnect(void);
void OnSend(void);
void OnReceive(void);
void OnClose(void);
private:
mysocket2 m_sConnectSocket;
mysocket2 m_sListenSocket;
public:
afx_msg void OnClickedBsend();
afx_msg void OnClickedBclose();
private:
CFineDfThresholdLB m_dFineDfThresholdLB;
public:
afx_msg void OnClickedFinedfthresholdlbbutton();
};