# Compilers
CXX := g++ -fPIC
http://www.fpx.de/fp/Software/tcl-c++/tcl-c++.html
Shared Library may be mapped into memory at different locations each time it is loaded, addresses within the library would be variable, therefore, all addresses inside the library are stored zero-based, relative to the beginning of the library. A register is then set aside to contain that address, so that all references in the library can be easily computed at runtime.
To compile a file for position-independence, you have to add custom switches to the compiler's command line. For example, gcc/egcs uses the `-fPIC switch.
g++?
http://forums.macrumors.com/showthread.php?t=132393
http://stackoverflow.com/questions/172587/what-is-the-difference-between-g-and-gcc
No comments:
Post a Comment