Will C compile .so to work with a C ++ application?

If I want to dynamically link a shared library (.so) for a C ++ application (which was created using g ++) using LD_PRELOAD, it matters if .so is generated from the C source file (using gcc) or the C + Source file + (using g ++)? Why or why not?

Thanks for helping me figure this out.

+4
source share
2 answers

Yes, a C ++ executable can be linked (both statically and dynamically) to the C library.

This is completely deliberate. C ++ ABI are designed for backward compatibility.

, .. , ++, extern "C", , . , , , .

+5

, .so. .so, FORTRAN. , .so.

.so C-, .

.so ++, .

, .so, FORTRAN, .

+1

All Articles