Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: troubles in making a filecopy program in visual c++ Pin
Joe Woodbury13-Jul-05 17:44
professionalJoe Woodbury13-Jul-05 17:44 
GeneralRe: troubles in making a filecopy program in visual c++ Pin
firebolt7714-Jul-05 0:21
firebolt7714-Jul-05 0:21 
QuestionDatabase existense in SQL Server ? Pin
Babarsaeed12-Jul-05 19:11
Babarsaeed12-Jul-05 19:11 
AnswerRe: Database existense in SQL Server ? Pin
Christian Graus12-Jul-05 19:51
protectorChristian Graus12-Jul-05 19:51 
AnswerRe: Database existense in SQL Server ? Pin
basementman13-Jul-05 5:00
basementman13-Jul-05 5:00 
Generalstatic global variables problem Pin
VV114412-Jul-05 19:07
VV114412-Jul-05 19:07 
GeneralRe: static global variables problem Pin
Christian Graus12-Jul-05 19:47
protectorChristian Graus12-Jul-05 19:47 
GeneralRe: static global variables problem Pin
Bob Stanneveld12-Jul-05 21:04
Bob Stanneveld12-Jul-05 21:04 
You declared it in a header didn't you? I've seen this problem here a few times and the solution is the following: don't declare variables in header files!

Tou immediatly think: how do I use global variables? Without the static keyword, the compiler complains of having multiple defined symbols!

The solution to this problem is not to add the static keyword, but to plave the variable in a translation unit (*.cpp file). In the header you declare the variable as extern:
// in the *.cpp file
Foo g_SomeGlobalFoo;

// in the header file
extern Foo g_SomeGlabalFoo;


This should solve your problem.

Behind every great black man...
            ... is the police. - Conspiracy brother


Blog[^]
GeneralRe: static global variables problem Pin
VV114413-Jul-05 7:06
VV114413-Jul-05 7:06 
GeneralRe: static global variables problem Pin
Bob Stanneveld13-Jul-05 20:28
Bob Stanneveld13-Jul-05 20:28 
GeneralXP-Style menu in win32 Pin
Anonymous12-Jul-05 18:36
Anonymous12-Jul-05 18:36 
GeneralRe: XP-Style menu in win32 Pin
Graham Bradshaw12-Jul-05 22:03
Graham Bradshaw12-Jul-05 22:03 
GeneralVirtualAlloc at specific address Pin
Blake V. Miller12-Jul-05 18:10
Blake V. Miller12-Jul-05 18:10 
GeneralRe: VirtualAlloc at specific address Pin
Toby Opferman12-Jul-05 19:56
Toby Opferman12-Jul-05 19:56 
GeneralRe: VirtualAlloc at specific address Pin
Blake Miller13-Jul-05 8:06
Blake Miller13-Jul-05 8:06 
GeneralTLS in a static library Pin
Chintoo72312-Jul-05 18:06
Chintoo72312-Jul-05 18:06 
GeneralRe: TLS in a static library Pin
Chintoo72312-Jul-05 18:15
Chintoo72312-Jul-05 18:15 
GeneralRe: TLS in a static library Pin
Magnus Westin13-Jul-05 2:32
Magnus Westin13-Jul-05 2:32 
GeneralBitmap in headcontrol does not work fine in Windows XP style Pin
lisoft12-Jul-05 16:26
lisoft12-Jul-05 16:26 
Generaltaskbar problem Pin
da^hype12-Jul-05 15:33
da^hype12-Jul-05 15:33 
GeneralRe: How to Insert a number into the Oracle Pin
Christian Graus12-Jul-05 17:33
protectorChristian Graus12-Jul-05 17:33 
Generalgetting yesterday's date Pin
Camron12-Jul-05 9:50
Camron12-Jul-05 9:50 
GeneralRe: getting yesterday's date Pin
Jose Lamas Rios12-Jul-05 10:01
Jose Lamas Rios12-Jul-05 10:01 
GeneralRe: getting yesterday's date Pin
David Crow12-Jul-05 10:09
David Crow12-Jul-05 10:09 
GeneralRe: getting yesterday's date Pin
#realJSOP12-Jul-05 10:13
mve#realJSOP12-Jul-05 10:13 

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.