Domanda

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!

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top