Write static library (ar, package), write dynamic library (sharing principle, -fPIC, -shared), install static library (system path (library name)/specified path (-I, -L option)), install dynamic library ( ldd,-static, tells the loader the path to search

Table of Contents How to write a library static library Introduction — static library principle form static library introduce ar Options Create static library Add files to existing static library After we have a library, how should we give it to others? dynamic library The difference between static library and dynamic library linking static library […]

[Solved] WRF install ‘can not be used when making a PIE object; recompile with -fPIC’ error resolved

In the ./compile em_real > & amp; log.compile this step has always reported an error when compiling Searching for error found that they are all PIE problems: ‘can not be used when making a PIE object; recompile with -fPIC’ Looking at various solutions, it is known that it is a problem of gcc compilation. Adding […]

[Solved] CentOS 7 not be used when making a shared object; recompile with -fPIC /usr/bin/ld: last link failed: error ld returned 1

Error environment CentOS7 [root@localhost ~]# gcc -fPIC -shared -o libdynamicprocess.so process.c process.o process.o: In function ‘create_process’: process.c:(.text + 0x0): Multiple definitions of create_process /tmp/ccLD4tNB.o:process.c:(.text + 0x0): first defined here /usr/bin/ld: process.o: relocation R_X86_64_PC32 against symbol `fork@@GLIBC_2.2.5′ can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: last link failed: bad value collect2: […]