[Updated: 04/07/2006] Much accurate information is available in a better format at:Mixed-Language Programming and External Linkage__________________It is a common practice to mix code written in one programming language with code written in another. But the developer needs to take some additional care to make such programs work; else the compilation endup with link errors about unresolved symbols. Let's discuss the problem(s) & solution(s) of mixing code written in different programming languages with a simple exampleAssume that we're writing...
Wednesday, 12 January 2005
Monday, 10 January 2005
Life cycle of a C/C++ program
Posted on 16:23 by Unknown
1) Write the programeg.,int main (int argc, char *argv[]) { printf ("Hello World");}2) Compile the programWhen the program gets compiled, the compiler realizes that the current compile unit (ie., the simple C program in this case) has no implementation for printf(), and therefore produces an entry in the object file's symbol table saying that printf() has an `unresolved reference'. And the compiler generates an object file (.o file) if there were no syntax errors in the program3) Link the object file(s)The next phase is to link the object...
Friday, 7 January 2005
2s complement
Posted on 20:28 by Unknown
In general, we (human beings) express negative numbers by placing a minus (-) sign at the left end of the number. Similarly while representing the integers in binary format, we can leave the left-most bit be the sign bit. If the left-most bit is a zero, the integer is positive; if it is a one, it is negative. To make it easy to design computers which do integer arithmetic, integers should obey the following rules: (1) Zero is positive and -0 = 0 (2) The top-most bit should tell us the sign of the integer. (3) The negative of a negative integer...
Thursday, 6 January 2005
Binary compatibility
Posted on 17:04 by Unknown
What's It?"Binary compatibility" (BC) is the ability of one machine to run software that was written for another without having to change or recompile the softwareBC of an Operating System:Binary compatibility of an OS is the ability to run application(s) that were built for one version of OS, on later versions of OS without having to change or rebuild the application; but the same application may not run on earlier versions of the operating systemFor example, if a software company wants to ship their product for Solaris 8, 9 & 10 platforms,...
Wednesday, 5 January 2005
Solaris: Tips
Posted on 16:16 by Unknown
* To approximate the amount of memory being used by the kernel: kstat | grep pp_kernel | awk '{ print ($2*8192)/(1024*1024), "MB"; }'* Kernel memory usage breakdown: echo "::memstat" | mdb -k (as "root")Page Summary Pages MB %Tot------------ ---------------- ---------------- ----Kernel 122064 953 12%Anon 147000 1148 15%Exec and libs 14329 111 1%Page cache 54188 423 5%Free (cachelist) 547198 4274 55%Free (freelist) 115649 903 12%Total 1000428 7815* Using alternative ld.so (on Solaris 9 or later versions): LD_LIBRARY_PATH=/path/as/needed...
Subscribe to:
Posts (Atom)