Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to suppress c++ name mangling?

I have a DLL that is written in C++ and I want to suppress the name mangling for a few exported methods. The methods are global and are not members of any class. Is there a way to achieve this?

BTW: I'm using VS2008.

like image 860
Ohad Horesh Avatar asked May 23 '09 20:05

Ohad Horesh


1 Answers

Surround the function definitions with extern "C" {}

extern "C" {
    void foo() {}
}

See http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html

like image 154
bradtgmurray Avatar answered Oct 05 '22 04:10

bradtgmurray