Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionTrouble with const Pin
Leslie Sanford31-Aug-07 13:19
Leslie Sanford31-Aug-07 13:19 
AnswerRe: Trouble with const Pin
Mark Salsbery31-Aug-07 13:26
Mark Salsbery31-Aug-07 13:26 
GeneralRe: Trouble with const Pin
Leslie Sanford31-Aug-07 13:41
Leslie Sanford31-Aug-07 13:41 
GeneralRe: Trouble with const Pin
Mark Salsbery31-Aug-07 13:52
Mark Salsbery31-Aug-07 13:52 
QuestionRe: Trouble with const Pin
Mark Salsbery31-Aug-07 13:54
Mark Salsbery31-Aug-07 13:54 
AnswerRe: Trouble with const Pin
Leslie Sanford31-Aug-07 14:22
Leslie Sanford31-Aug-07 14:22 
GeneralRe: Trouble with const Pin
Mark Salsbery31-Aug-07 15:36
Mark Salsbery31-Aug-07 15:36 
GeneralRe: Trouble with const Pin
Leslie Sanford31-Aug-07 16:02
Leslie Sanford31-Aug-07 16:02 
Mark Salsbery wrote:
Again, this compiles and links for me


I should have paid more attention when you said this before instead of continuing to assume there was a problem with const.

If I include the header file in the implementation file that has the const array, everything works correctly; no more linking errors:

Wavetable.h:

extern const unsigned char Sawtooth[];


Sawtooth.cpp:

#include "Wavetable.h"
 
const unsigned char Sawtooth[] = 
{
    // A bunch of values...
};


I'm not sure why, but including the header file in my Sawtooth.cpp file solved the problem. I can keep the const modifier.
GeneralRe: Trouble with const Pin
Mark Salsbery1-Sep-07 7:05
Mark Salsbery1-Sep-07 7:05 
AnswerRe: Trouble with const Pin
Leslie Sanford31-Aug-07 15:04
Leslie Sanford31-Aug-07 15:04 
GeneralRe: Trouble with const Pin
Mark Salsbery31-Aug-07 15:33
Mark Salsbery31-Aug-07 15:33 
QuestionHow ot verify whether or not a user is a member of a local or domain group? Pin
Homayoun231-Aug-07 13:12
Homayoun231-Aug-07 13:12 
QuestionMFC Control Design Pattern Question Pin
@largeinsd31-Aug-07 10:56
@largeinsd31-Aug-07 10:56 
QuestionCStdioFile issue Pin
__yash__31-Aug-07 10:40
professional__yash__31-Aug-07 10:40 
AnswerRe: CStdioFile issue Pin
__yash__31-Aug-07 10:48
professional__yash__31-Aug-07 10:48 
QuestionCListCtrl::SetBkImage(): how disable the image scroll? Pin
Cris31-Aug-07 8:27
Cris31-Aug-07 8:27 
AnswerRe: CListCtrl::SetBkImage(): how disable the image scroll? Pin
Cris3-Sep-07 3:13
Cris3-Sep-07 3:13 
QuestionCancel opening a file Pin
AeJai31-Aug-07 8:10
AeJai31-Aug-07 8:10 
AnswerRe: Cancel opening a file Pin
PJ Arends31-Aug-07 9:38
professionalPJ Arends31-Aug-07 9:38 
QuestionWM_TIMER Pin
__yash__31-Aug-07 7:28
professional__yash__31-Aug-07 7:28 
AnswerRe: WM_TIMER Pin
Mark Salsbery31-Aug-07 8:01
Mark Salsbery31-Aug-07 8:01 
GeneralRe: WM_TIMER Pin
Waldermort31-Aug-07 9:33
Waldermort31-Aug-07 9:33 
GeneralRe: WM_TIMER Pin
Mark Salsbery31-Aug-07 9:42
Mark Salsbery31-Aug-07 9:42 
AnswerRe: WM_TIMER Pin
Waldermort31-Aug-07 9:34
Waldermort31-Aug-07 9:34 
GeneralRe: WM_TIMER Pin
__yash__31-Aug-07 9:40
professional__yash__31-Aug-07 9:40 

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.