C code compiled with C++: undefined reference

前端 未结 4 1645
一个人的身影
一个人的身影 2021-02-14 23:31

I have a small program that I can compile with GCC and ICC without any difficulties, but I would also like the code to work with G++ and ICPC. I tried to add this:



        
4条回答
  •  -上瘾入骨i
    2021-02-15 00:34

    See my response to this earlier question: When to use extern "C" in simple words?

    It should hopefully make it clear how to mix C and C++ code.

提交回复
热议问题