Click here to Skip to main content
15,905,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: what does #line really do Pin
Ryan Binns9-Feb-05 17:32
Ryan Binns9-Feb-05 17:32 
GeneralDebug another Process Pin
Chris Meech9-Feb-05 9:19
Chris Meech9-Feb-05 9:19 
GeneralRe: Debug another Process Pin
Chris Losinger9-Feb-05 9:22
professionalChris Losinger9-Feb-05 9:22 
GeneralRe: Debug another Process Pin
Chris Meech9-Feb-05 9:40
Chris Meech9-Feb-05 9:40 
QuestionHow about this... Pin
bilas9-Feb-05 8:57
bilas9-Feb-05 8:57 
AnswerRe: How about this... Pin
Neville Franks9-Feb-05 10:20
Neville Franks9-Feb-05 10:20 
GeneralRe: How about this... Pin
bilas10-Feb-05 6:32
bilas10-Feb-05 6:32 
Generaldefining a string constant Pin
K. Shaffer9-Feb-05 7:14
K. Shaffer9-Feb-05 7:14 
I have a constants.h file that I would like to use to store constants and such.

When I include the file in a class in my project I keep getting Link Error:2005: "already defined in" errors when I try to declare a string constant in the constant.h file.

How do I create global string constants that I can use througout my app?


// constants.h: defines constants to be used througout application.
//
//////////////////////////////////////////////////////////////////////

#if !defined(APP_CONSTANTS_0209051212)
#define APP_CONSTANTS_0209051212

//no problems here
const APP_PATH_STRING_LENGTH = 255;

//link errors when using these
char* app_data_path = "data\\";
char* app_charts_path = "c:\\CHARTS\\";


#endif // !defined(APP_CONSTANTS_0209051212)


Kevin Shaffer
kshaff03@msn.com
GeneralRe: defining a string constant Pin
K. Shaffer9-Feb-05 7:22
K. Shaffer9-Feb-05 7:22 
GeneralRe: defining a string constant Pin
Chris Losinger9-Feb-05 9:24
professionalChris Losinger9-Feb-05 9:24 
GeneralRe: defining a string constant Pin
K. Shaffer9-Feb-05 10:26
K. Shaffer9-Feb-05 10:26 
GeneralA question about Microsoft Visual C++ 6.0 Pin
Piccinano9-Feb-05 6:40
Piccinano9-Feb-05 6:40 
GeneralRe: A question about Microsoft Visual C++ 6.0 Pin
RChin9-Feb-05 6:45
RChin9-Feb-05 6:45 
GeneralRe: A question about Microsoft Visual C++ 6.0 Pin
Antony M Kancidrowski9-Feb-05 6:45
Antony M Kancidrowski9-Feb-05 6:45 
GeneralRe: A question about Microsoft Visual C++ 6.0 Pin
Piccinano9-Feb-05 6:54
Piccinano9-Feb-05 6:54 
QuestionProxy chains? Pin
Hoornet939-Feb-05 5:22
Hoornet939-Feb-05 5:22 
AnswerRe: Proxy chains? Pin
Hoornet9317-Mar-05 3:31
Hoornet9317-Mar-05 3:31 
GeneralFirst Win32 Program Pin
Member 17030439-Feb-05 5:10
Member 17030439-Feb-05 5:10 
GeneralRe: First Win32 Program Pin
Blake Miller9-Feb-05 7:29
Blake Miller9-Feb-05 7:29 
GeneralRe: First Win32 Program Pin
Member 17030439-Feb-05 7:50
Member 17030439-Feb-05 7:50 
GeneralRe: First Win32 Program Pin
Blake Miller9-Feb-05 8:05
Blake Miller9-Feb-05 8:05 
GeneralRe: First Win32 Program Pin
Ryan Binns9-Feb-05 17:44
Ryan Binns9-Feb-05 17:44 
GeneralRe: First Win32 Program Pin
Blake Miller10-Feb-05 4:07
Blake Miller10-Feb-05 4:07 
GeneralRe: First Win32 Program Pin
Ryan Binns10-Feb-05 12:42
Ryan Binns10-Feb-05 12:42 
GeneralRe: First Win32 Program Pin
Blake Miller11-Feb-05 4:02
Blake Miller11-Feb-05 4:02 

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.