LD_PRELOAD with several source files
-
10-06-2021 - |
문제
I writed LD_PRELOAD module, all my sources are in source.cpp
, but now i need to add crypt.cpp
file with some classes i need, how can i compile LD_PRELOAD via g++ using more that one .cpp file?
Thanks!
해결책
If your command to build the preload library was:
g++ -fPIC -shared -o preload.so source.cpp
then you would change it to:
g++ -fPIC -shared -o preload.so source.cpp crypt.cpp
i.e. you simply add the name of the file to the end of the command line compiling the .cpp files.
제휴하지 않습니다 StackOverflow