The Libnet. A static library must be linked at the same time as the. La dynamic library is generated during the recent project process.
Libcharon_la_libadd + =/usr/lib/Libnet.
However, an error is reported during compilation:
/Usr/bin/ld:/usr/lib/Libnet. A (libnet_build_ip.o): Relocation r_x86_64_32 against 'a local symplo' can not
Be used when making a shared object; recompile with-FPIC
This should be in conflict with the 64-bit system. Later, I tried to add the-FPIC compilation option in makefile, but the error still persists. There should be solutions in this article,
However, if you have time to try it, you may need to create a sub-directory for the. A static library and write a makefile. Am file, which specifies the content similar to the following:
Noinst_libraries = libjupcommon.
Libjupcommon_a_sources = jupcommon. h print. c
Libjupcommon_a_cflags =-FPIC
Another officially recommended method is to replace the. A static library with the. La dynamic library for link.
My current practice is to link. the code of a static library is divided into makefile of executable files. am, so use charon_ldadd =/usr/lib/Libnet. A.
And will not conflict with the link of the static library.