Click here to Skip to main content
15,915,172 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionstatic variables in stdafx.h Pin
werpa21-Mar-07 5:07
werpa21-Mar-07 5:07 
AnswerRe: static variables in stdafx.h Pin
toxcct21-Mar-07 5:13
toxcct21-Mar-07 5:13 
GeneralRe: static variables in stdafx.h Pin
werpa21-Mar-07 5:19
werpa21-Mar-07 5:19 
GeneralRe: static variables in stdafx.h Pin
David Crow21-Mar-07 6:31
David Crow21-Mar-07 6:31 
QuestionRe: static variables in stdafx.h Pin
David Crow21-Mar-07 5:15
David Crow21-Mar-07 5:15 
AnswerRe: static variables in stdafx.h Pin
werpa21-Mar-07 5:22
werpa21-Mar-07 5:22 
GeneralRe: static variables in stdafx.h Pin
toxcct21-Mar-07 5:29
toxcct21-Mar-07 5:29 
GeneralRe: static variables in stdafx.h Pin
David Crow21-Mar-07 5:31
David Crow21-Mar-07 5:31 
werpa wrote:
I need to make it "static" in order to keep from getting fatal LNK1169 error "one or more multiply defined symbols found"


Something is amiss with your stdafx.h file. It should resemble:

#if !defined(STDAFX_H)
#define AFX_STDAFX_H
 
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
 
#define _WIN32_WINNT 0x0500
 
int m_foo;
 
#endif



"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

"Judge not by the eye but by the heart." - Native American Proverb


GeneralRe: static variables in stdafx.h Pin
werpa21-Mar-07 5:42
werpa21-Mar-07 5:42 
GeneralRe: static variables in stdafx.h Pin
David Crow21-Mar-07 5:51
David Crow21-Mar-07 5:51 
GeneralRe: static variables in stdafx.h Pin
werpa21-Mar-07 6:05
werpa21-Mar-07 6:05 
QuestionRe: static variables in stdafx.h Pin
Mark Salsbery21-Mar-07 6:59
Mark Salsbery21-Mar-07 6:59 
AnswerRe: static variables in stdafx.h Pin
toxcct21-Mar-07 7:09
toxcct21-Mar-07 7:09 
GeneralRe: static variables in stdafx.h Pin
Mark Salsbery21-Mar-07 7:22
Mark Salsbery21-Mar-07 7:22 
AnswerRe: static variables in stdafx.h Pin
David Crow21-Mar-07 7:15
David Crow21-Mar-07 7:15 
GeneralRe: static variables in stdafx.h Pin
Mark Salsbery21-Mar-07 7:19
Mark Salsbery21-Mar-07 7:19 
GeneralRe: static variables in stdafx.h Pin
Stephen Hewitt21-Mar-07 16:31
Stephen Hewitt21-Mar-07 16:31 
GeneralRe: static variables in stdafx.h Pin
David Crow22-Mar-07 2:49
David Crow22-Mar-07 2:49 
GeneralRe: static variables in stdafx.h Pin
Stephen Hewitt22-Mar-07 12:35
Stephen Hewitt22-Mar-07 12:35 
GeneralRe: static variables in stdafx.h Pin
Mark Salsbery22-Mar-07 8:07
Mark Salsbery22-Mar-07 8:07 
AnswerRe: static variables in stdafx.h Pin
Nemanja Trifunovic21-Mar-07 6:10
Nemanja Trifunovic21-Mar-07 6:10 
AnswerRe: static variables in stdafx.h Pin
Stephen Hewitt21-Mar-07 16:33
Stephen Hewitt21-Mar-07 16:33 
AnswerRe: static variables in stdafx.h Pin
werpa22-Mar-07 5:30
werpa22-Mar-07 5:30 
Questionmalloc / free Pin
Ing.Raiz8221-Mar-07 4:57
Ing.Raiz8221-Mar-07 4:57 
AnswerRe: malloc / free Pin
toxcct21-Mar-07 5:05
toxcct21-Mar-07 5:05 

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.