简体   繁体   中英

gcc and g++ linker

I am not yet at the point of linking, but as soon as my project compiles I will face this issue:

  • I have one co object file compiled by gcc from pure C code
  • I have one do object file compiled by g++ with extern"C" for C compatibility of functions that needs to be callable by the co
  • I have a lot of *.o object files compiled by g++ from pure C++ code that are called by the do part

How should I link the whole as a one block shared library? Using gcc or g++? This library will then be used by Apache2 as a C module.

Using g++ you can link both types of .o files. Only gcc will fail.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM