我在centos 6上使用gnu c编译器,c程序dynamic地在代码中加载共享库。
你必须声明你的函数在C :
extern "C" void foo(int x, char y);
请注意,您不能重载或C ++为您提供的任何其他功能。 (这是因为名字混乱 )