Click here to Skip to main content
16,005,121 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSymbol Already defined... Pin
Polite Programmer9-May-06 20:50
Polite Programmer9-May-06 20:50 
AnswerRe: Symbol Already defined... Pin
Nibu babu thomas9-May-06 20:56
Nibu babu thomas9-May-06 20:56 
AnswerRe: Symbol Already defined... Pin
Stephen Hewitt9-May-06 21:02
Stephen Hewitt9-May-06 21:02 
AnswerRe: Symbol Already defined... Pin
Hamid_RT9-May-06 21:09
Hamid_RT9-May-06 21:09 
GeneralRe: Symbol Already defined... Pin
Stephen Hewitt9-May-06 21:19
Stephen Hewitt9-May-06 21:19 
GeneralRe: Symbol Already defined... Pin
Hamid_RT9-May-06 22:05
Hamid_RT9-May-06 22:05 
GeneralRe: Symbol Already defined... Pin
Polite Programmer10-May-06 0:39
Polite Programmer10-May-06 0:39 
GeneralRe: Symbol Already defined... Pin
Justin Tay10-May-06 16:09
Justin Tay10-May-06 16:09 
extern tells your compiler that this symbol is defined elsewhere and not to worry about it if it can't find it in this compilation unit (object code). Basically it passes the problem to the linker.

If you have more than one definition for this symbol in separate cpp files the linker will complain that the symbol is already defined. This is what will happen if you try to define your array in more than one cpp file.

If you have no definition for this symbol in all your cpp files the linker will complain that it can't find the symbol.

In certain cases where it is desirable to have the definition in the header file, you can use __declspec(selectany) to indicate to the linker that if it finds multiple symbols, to just pick one.
GeneralRe: Symbol Already defined... Pin
Stephen Hewitt10-May-06 21:50
Stephen Hewitt10-May-06 21:50 
QuestionDiable Restore Button Pin
vinod.sankuthodi9-May-06 20:46
vinod.sankuthodi9-May-06 20:46 
AnswerRe: Disable Restore Button Pin
Nibu babu thomas9-May-06 21:14
Nibu babu thomas9-May-06 21:14 
QuestionOPC connection Pin
Anu_Bala9-May-06 20:41
Anu_Bala9-May-06 20:41 
QuestionAtlAdvise with IE hangs Pin
rana749-May-06 20:38
rana749-May-06 20:38 
AnswerRe: Accessing global address book from outlook using c# Pin
Cedric Moonen9-May-06 20:33
Cedric Moonen9-May-06 20:33 
QuestionStyle in Splitter Pin
RockyJames9-May-06 19:50
RockyJames9-May-06 19:50 
Question2 process Pin
VinayCool9-May-06 19:25
VinayCool9-May-06 19:25 
AnswerRe: 2 process Pin
Ganesh_T9-May-06 19:35
Ganesh_T9-May-06 19:35 
GeneralRe: 2 process Pin
VinayCool9-May-06 19:38
VinayCool9-May-06 19:38 
GeneralRe: 2 process Pin
Ganesh_T9-May-06 19:49
Ganesh_T9-May-06 19:49 
AnswerRe: 2 process Pin
Hamid_RT9-May-06 19:38
Hamid_RT9-May-06 19:38 
AnswerRe: 2 process Pin
Stephen Hewitt9-May-06 19:40
Stephen Hewitt9-May-06 19:40 
QuestionHow to interact with IE Browser? Pin
captaincse9-May-06 19:16
captaincse9-May-06 19:16 
AnswerRe: How to interact with IE Browser? Pin
Ganesh_T9-May-06 19:38
Ganesh_T9-May-06 19:38 
QuestionIs there any CInt function - VB in c++? Pin
Joy Anne9-May-06 18:41
Joy Anne9-May-06 18:41 
AnswerRe: Is there any CInt function - VB in c++? Pin
Maxwell Chen9-May-06 18:52
Maxwell Chen9-May-06 18:52 

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.