¡@

Home 

c++ Programming Glossary: main2.c

Multiple definition of inline functions when linking static libs

http://stackoverflow.com/questions/2217628/multiple-definition-of-inline-functions-when-linking-static-libs

void f void printf inline def main1.c n void g void f main2.c #include stdio.h external definition extern inline void f void.. outputs what we expected gcc std c99 O2 main.c main1.c main2.c inline def main.c inline def main1.c external def external def..

Linking with multiple versions of a library

http://stackoverflow.com/questions/3232822/linking-with-multiple-versions-of-a-library

called not the version linked into the shared library. In main2.c we have #include stdio.h #include dlfcn.h int bar printf bar.. #include stdio.h #include dlfcn.h int bar printf bar in main2.c called n return 0 int main int x int foo void handle dlopen.. d n foo printf result from bar is d n bar Compile and run main2.c notice we dont need to explicitly link with libfoo.so gcc o..