olfa7183
Messages postés17Date d'inscriptionjeudi 3 juillet 2008StatutMembreDernière intervention27 septembre 2008
-
3 sept. 2008 à 10:46
fregolo52
Messages postés1114Date d'inscriptionmercredi 15 juin 2011StatutMembreDernière intervention 6 mai 2021
-
3 sept. 2008 à 15:06
bonjour,
j'ai un projet prgramme avec visual studio C++ 6.0
lors de compilation tout est bien mais à l'exécution j'obtient des erreurs de linkage.
je veux savoir c'est dû à quoi ses erreures et de m'aider à résoudre ces problèmes.
voila les erreurs que j'obtient:
-------------------Configuration: Monnayeur - Win32 Debug--------------------
Linking...
Monnayeur.obj : error LNK2005: "public: __thiscall CAboutDlg::CAboutDlg(void)" (??0CAboutDlg@@QAE@XZ) already defined in ccDLL_TestDlg.obj
Monnayeur.obj : error LNK2005: "protected: virtual void __thiscall CAboutDlg::DoDataExchange(class CDataExchange *)" (?DoDataExchange@CAboutDlg@@MAEXPAVCDataExchange@@@Z) already defined in ccDLL_TestDlg.obj
Monnayeur.obj : error LNK2005: "protected: virtual struct AFX_MSGMAP const * __thiscall CAboutDlg::GetMessageMap(void)const " (?GetMessageMap@CAboutDlg@@MBEPBUAFX_MSGMAP@@XZ) already defined in ccDLL_TestDlg.obj
Monnayeur.obj : error LNK2005: "protected: static struct AFX_MSGMAP const CAboutDlg::messageMap" (?messageMap@CAboutDlg@@1UAFX_MSGMAP@@B) already defined in ccDLL_TestDlg.obj
Monnayeur.obj : error LNK2005: "private: static struct AFX_MSGMAP_ENTRY const * const CAboutDlg::_messageEntries" (?_messageEntries@CAboutDlg@@0QBUAFX_MSGMAP_ENTRY@@B) already defined in ccDLL_TestDlg.obj
ccDLL_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall ccDLL_TestDlg::GetRuntimeClass(void)const " (?GetRuntimeClass@ccDLL_TestDlg@@UBEPAUCRuntimeClass@@XZ)
Debug/Monnayeur.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Monnayeur.exe - 7 error(s), 0 warning(s)
d'pres que j'ai compris c'est que les erreurs se trouvent dans ccDll_TestDlg, olors j'ai essaye de suprime le programme ccDll_TestDlg j'obtient 0 erreurs
voici mon programme:
// Symbol für dieses Dialogfeld festlegen. Wird automatisch erledigt
// wenn das Hauptfenster der Anwendung kein Dialogfeld ist
SetIcon(m_hIcon, TRUE); // Großes Symbol verwenden
SetIcon(m_hIcon, FALSE); // Kleines Symbol verwenden
// Initialise ccTalk classes
pCcComm = new CcTalkCommunication();
pCcDev = new CcTalkDevice(pCcComm);
pCcSel = new CCoinSelector(pCcComm);
pCcPeri = new CPeripheral(pCcComm);
pCcPot = new CPayout(pCcComm);
pCcVal = new CBillValidator(pCcComm);
// Wenn Sie dem Dialogfeld eine Schaltfläche "Minimieren" hinzufügen, benötigen Sie
// den nachstehenden Code, um das Symbol zu zeichnen. Für MFC-Anwendungen, die das
// Dokument/Ansicht-Modell verwenden, wird dies automatisch ausgeführt.
void ccDLL_TestDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // Gerätekontext zum Zeichnen
// Symbol in Clientrechteck zentrieren
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Symbol zeichnen
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// Die System ruft diese Funktion auf, um den Cursor abzufragen, der angezeigt wird, während der Benutzer
// das minimierte Fenster mit der Maus zieht.
HCURSOR ccDLL_TestDlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
// Try to open the com port
void ccDLL_TestDlg::OnBnClickedButton1()
{
int comport, res;
}
// Send Break
void ccDLL_TestDlg::OnBnClickedButton4()
{
pCcComm->SendBreak();
}
// Try to close the com port
void ccDLL_TestDlg::OnBnClickedButton2()
{
int res;
res = pCcComm->CloseComm();
m_CommResult = res;
UpdateData(0);
EnableButtons(CCCAT_UNKNOWN);
}
// Get core info
void ccDLL_TestDlg::OnBnClickedButton3()
{
int res, addr;
char cbxtxt[32];
CCTALK_COREINFO coreinf;
CCTALK_COINS money;
UpdateData(1);
m_cbxAddressList.GetLBText(m_cbxAddressList.GetCurSel(), cbxtxt);
// Read and set up comm parameters
sscanf(cbxtxt, "%d", &addr); // Device address
pCcDev->SetDeviceAddress(addr);
if (m_cbxChecksum.GetCurSel() == 0) // Checksum type
pCcDev->SetChecksumType(CSUM_SIMPLE8);
else
pCcDev->SetChecksumType(CSUM_CRC16);
if (m_cbxEncryption.GetCurSel() == 0) // Encryption
pCcDev->SetEncryption(ENCRYPT_NONE);
else
pCcDev->SetEncryption(ENCRYPT_MCBNV);
LPTSTR pinbff = m_PIN.GetBuffer(0);
if (m_PIN.GetLength() == 6) for (int i 0; i < 6; i++) m_pin[i] pinbff[i] - '0';
else for (int i 0; i < 6; i++) m_pin[i] 0;
pCcDev->InitPINCode(m_pin);