Click here to Skip to main content
15,913,090 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMoveFile crashing Pin
alex.barylski22-Aug-04 18:58
alex.barylski22-Aug-04 18:58 
GeneralRe: MoveFile crashing Pin
palbano22-Aug-04 19:10
palbano22-Aug-04 19:10 
GeneralRe: MoveFile crashing Pin
alex.barylski22-Aug-04 19:40
alex.barylski22-Aug-04 19:40 
GeneralRe: MoveFile crashing Pin
palbano23-Aug-04 21:00
palbano23-Aug-04 21:00 
GeneralRe: MoveFile crashing Pin
Michael P Butler23-Aug-04 0:44
Michael P Butler23-Aug-04 0:44 
Generalapply and save watermark (asap) Pin
bit_mca22-Aug-04 18:55
bit_mca22-Aug-04 18:55 
QuestionHow to control execution order Pin
I2A4U22-Aug-04 16:42
I2A4U22-Aug-04 16:42 
AnswerRe: How to control execution order Pin
Antti Keskinen22-Aug-04 21:06
Antti Keskinen22-Aug-04 21:06 
In this case, the extern keyword will make the linker search other compiled modules for the declaraction of gO1. It will find this from green.obj, and thus make external linkage with this variable.

In the sense of execution order, after the compiler has compiled the modules, the linker must add them in the order green.obj -> blue.obj. Otherwise the generated code cannot resolve the symbol gO1.

In this solution, you are relying on the linker to determine the execution order. To have more control over the execution order, you should specify the main executable function ( int main(void) ), or the starting point function. Otherwise this piece of your code won't do anything.

One final option is to use the #include keyword at the start of blue.cpp to include green.cpp there. In this case, you also need to exclude green.cpp from the build. To do this, click on green.cpp in Solution Explorer, right-click, choose 'Properties' and mark it as 'Excluded from build'. Also, you don't need to include o.h in the blue.cpp anymore, as green.cpp already does that.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: How to control execution order Pin
I2A4U23-Aug-04 1:12
I2A4U23-Aug-04 1:12 
Generalabout Webbrowse Pin
runner11122-Aug-04 16:35
runner11122-Aug-04 16:35 
GeneralRe: about Webbrowse Pin
Abhi Lahare22-Aug-04 19:03
Abhi Lahare22-Aug-04 19:03 
GeneralAccessing Windows User Account Pin
wildan_ali22-Aug-04 15:19
wildan_ali22-Aug-04 15:19 
GeneralRe: Accessing Windows User Account Pin
ThatsAlok22-Aug-04 21:22
ThatsAlok22-Aug-04 21:22 
GeneralRe: Accessing Windows User Account Pin
wildan_ali22-Aug-04 21:52
wildan_ali22-Aug-04 21:52 
GeneralRe: Accessing Windows User Account Pin
ThatsAlok23-Aug-04 0:59
ThatsAlok23-Aug-04 0:59 
GeneralConfusing Mouse Operations Pin
radiox22-Aug-04 15:04
radiox22-Aug-04 15:04 
GeneralRe: Confusing Mouse Operations Pin
radiox22-Aug-04 15:43
radiox22-Aug-04 15:43 
Generaldialog, edit control - No.2 Pin
emo75u22-Aug-04 13:40
emo75u22-Aug-04 13:40 
GeneralRe: dialog, edit control - No.2 Pin
Ivan Cachicatari23-Aug-04 8:05
Ivan Cachicatari23-Aug-04 8:05 
GeneralTheme madness! Pin
Jörgen Sigvardsson22-Aug-04 9:21
Jörgen Sigvardsson22-Aug-04 9:21 
GeneralGDI Objects in Windows Task Manager Pin
Jörgen Sigvardsson22-Aug-04 9:18
Jörgen Sigvardsson22-Aug-04 9:18 
GeneralRe: GDI Objects in Windows Task Manager Pin
Neville Franks22-Aug-04 10:44
Neville Franks22-Aug-04 10:44 
GeneralRe: GDI Objects in Windows Task Manager Pin
Jörgen Sigvardsson22-Aug-04 10:48
Jörgen Sigvardsson22-Aug-04 10:48 
GeneralRe: GDI Objects in Windows Task Manager Pin
Neville Franks22-Aug-04 10:55
Neville Franks22-Aug-04 10:55 
GeneralRe: GDI Objects in Windows Task Manager Pin
Jörgen Sigvardsson22-Aug-04 10:50
Jörgen Sigvardsson22-Aug-04 10:50 

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.