Re: [Dev-C++] Split code in public/private parts - Help please
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ferdinando F. <s2...@st...> - 2004-01-10 18:57:35
|
> How can I compile "part two" (which has no "main" function), > so that the source code cannot be seen anymore ? You can put "part two" in a separate file, and compile it singularly, then distribute the output file (with .o extension). > Then, how can I compile "part one" source code (which has > the "main" function) with "part two" compiled version? You have to include in your project the .o file selecting "include in link" and deselecting "include in compilation", or equivalently build a library from it (a .a file), call it e.g. libp2.a, and specify "-lp2" in linker options. > How can I make sure it is not possible > to call directly another function of "part two" ? _Really_ you can't, but only who knows the implementation (or is a good and patient reverse engineer) know what's inside an object file. You should put declarations for all functions you would like a programmer to call in a header (.h) and distribute it with your .o or .a file. Bye, Ferdinando. |