문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top