Click here to Skip to main content
15,907,913 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: monitoring registry Pin
Ganesh_T10-Apr-06 0:39
Ganesh_T10-Apr-06 0:39 
AnswerRe: monitoring registry Pin
David Crow10-Apr-06 2:29
David Crow10-Apr-06 2:29 
GeneralRe: monitoring registry Pin
kiranin13-Apr-06 0:19
kiranin13-Apr-06 0:19 
GeneralRe: monitoring registry Pin
David Crow13-Apr-06 2:27
David Crow13-Apr-06 2:27 
QuestionRe: howto insert a control inside of a groupbox Pin
David Crow10-Apr-06 2:30
David Crow10-Apr-06 2:30 
Questionhow come this happen? thank you Pin
ewighell10-Apr-06 0:31
ewighell10-Apr-06 0:31 
AnswerRe: how come this happen? thank you Pin
Stephen Hewitt10-Apr-06 13:44
Stephen Hewitt10-Apr-06 13:44 
Questionhow come this happen? thank you very much Pin
ewighell10-Apr-06 0:25
ewighell10-Apr-06 0:25 
I build a dialog based MFC program.

in the file "StdAfx.h" I add the following code,which is used to define a global variable of type CString.
#ifndef jjjjjjjjjjjjjjjjjjj
#define jjjjjjjjjjjjjjjjjjj
CString StrGlobal;
#endif


and then I use it in another file "newfile.cpp"
#include "stdafx.h"
extern CString StrGlobal;
void fun()
{
   StrGlobal = _T("KDKDK");
}


when I build the program, following link error shows up:

Linking...
StdAfx.obj : error LNK2005: "class CString StrGlobal" (?StrGlobal@@3VCString@@A) already defined in newfile.obj

why dose this happen? and how can I fix it ?

Thank you very much!!!

-------------------
I am learning C++ and English
AnswerRe: how come this happen? thank you very much Pin
Naveen10-Apr-06 0:33
Naveen10-Apr-06 0:33 
GeneralRe: how come this happen? thank you very much Pin
ewighell10-Apr-06 1:08
ewighell10-Apr-06 1:08 
GeneralRe: how come this happen? thank you very much Pin
Naveen10-Apr-06 1:22
Naveen10-Apr-06 1:22 
AnswerRe: how come this happen? thank you very much Pin
Nibu babu thomas10-Apr-06 18:12
Nibu babu thomas10-Apr-06 18:12 
QuestionBackup Utility Pin
aaaan10-Apr-06 0:16
aaaan10-Apr-06 0:16 
AnswerRe: Backup Utility Pin
Ganesh_T10-Apr-06 0:48
Ganesh_T10-Apr-06 0:48 
QuestionRe: Backup Utility Pin
David Crow10-Apr-06 2:58
David Crow10-Apr-06 2:58 
AnswerRe: Backup Utility Pin
David Crow10-Apr-06 2:57
David Crow10-Apr-06 2:57 
QuestionDrawLine On CaptureWindow Pin
nileshnaseet10-Apr-06 0:14
nileshnaseet10-Apr-06 0:14 
QuestionDrawing Line On CaptureWindow Pin
nileshnaseet10-Apr-06 0:14
nileshnaseet10-Apr-06 0:14 
QuestionWant to disable space bar. Pin
Aryan S10-Apr-06 0:06
Aryan S10-Apr-06 0:06 
AnswerRe: Want to disable space bar. Pin
Amar Sutar10-Apr-06 0:20
Amar Sutar10-Apr-06 0:20 
GeneralRe: Want to disable space bar. Pin
Aryan S10-Apr-06 0:40
Aryan S10-Apr-06 0:40 
AnswerRe: Want to disable space bar. Pin
Naveen10-Apr-06 0:30
Naveen10-Apr-06 0:30 
AnswerRe: Want to disable space bar. Pin
Laxman Auti10-Apr-06 0:38
Laxman Auti10-Apr-06 0:38 
QuestionA Question About VC++, CORBA and .Net Pin
a_kiani9-Apr-06 23:43
a_kiani9-Apr-06 23:43 
QuestionOpenCV Pin
EhsB9-Apr-06 22:47
EhsB9-Apr-06 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.