How does C's “extern” work?

后端 未结 7 1502
轻奢々
轻奢々 2020-12-28 10:56

I have a C/C++ program that\'s a plugin to Firefox. Because it\'s a plugin, it has non-main entry points. Those entrypoints need to be compiled in C because otherwise they g

7条回答
  •  轮回少年
    2020-12-28 11:31

    if the .c file includes the .h file and the function prototypes in the .h file are in an extern "C" block, everything should be ok. The functions declared as extern "C" won't have mangled names, all the other functions will.

提交回复
热议问题