Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fox's smart compiler
Message
From
11/10/2001 13:56:59
 
General information
Forum:
Visual FoxPro
Category:
Project manager
Miscellaneous
Thread ID:
00567111
Message ID:
00567122
Views:
13
>Okay, I think I've got my wires crossed. I've been reading a little about C++ lately and I think I've got my compilers mixed up.
>
>If you have a procedure library with 100 procedures in it that you include in your app, I was under the impression that the only binary ("p-code?") that gets put into your exe is the actual procedures that you call.
>

I don't think this is a true statement (for VFP). If you include a procedure in the project, it gets included in the .exe, even if those functions are never referenced in other places. VFP does not analyze function calls at compile time. < SNIP -- deleted erroneous sentence >

For C (and C++, I suppose), the answer is "sorta". Creating an .exe is a two-step process: compile, and link. Compiling creates object files. If an object file is explicitly included in a project, it is included in the .exe, whether or not it is called by other code. However, if the object files are placed into a library, they are only linked in if one of the functions are referenced in another object file. In this scenario, the entire object file (the one in the library) is linked into the .exe, even if only one of its functions is going to be called.

HTH,
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform